Class MessageResourcesConsolidator


  • public class MessageResourcesConsolidator
    extends java.lang.Object
    Consolidates the main message resources file, the german resources file and the old german resources file sent to UBS in one file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void consolidateResources​(java.io.File outputFile, java.lang.String currentTranslatedFile, java.lang.String defaultFile, java.lang.String translationLastRelease)
      Consolidates resources and creates a file with the consolidated message keys.
      private java.util.Map<java.lang.String,​java.lang.String> getDistinctKeys​(java.util.Properties properties1, java.util.Properties properties2)  
      private java.util.Map<java.lang.String,​java.lang.String> getKeysWithDifferentValues​(java.util.Properties propertiesDe, java.util.Properties propertiesSent)  
      private java.util.Map<java.lang.String,​java.lang.String> getKeysWithSameValues​(java.util.Properties propertiesDe, java.util.Properties propertiesSent)  
      private java.util.Map<java.lang.String,​java.lang.String> getNewKeysList​(java.util.Map<java.lang.String,​java.lang.String> keysInDefaultNotInDe, java.util.Map<java.lang.String,​java.lang.String> newlyAddedKeysInDe)  
      private java.util.List<java.lang.String> mapToSortedList​(java.util.Map<java.lang.String,​java.lang.String> map)  
      private void printInFile​(java.io.File outputFile, java.util.List<java.lang.String> newKeysList, java.util.List<java.lang.String> removedKeysList, java.util.List<java.lang.String> modifiedKeysList, java.util.List<java.lang.String> sameKeysList)  
      private void removeDeletedKeys​(java.util.Map<java.lang.String,​java.lang.String> newKeysMap, java.util.Map<java.lang.String,​java.lang.String> removedKeys)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MessageResourcesConsolidator

        public MessageResourcesConsolidator()
    • Method Detail

      • consolidateResources

        public void consolidateResources​(java.io.File outputFile,
                                         java.lang.String currentTranslatedFile,
                                         java.lang.String defaultFile,
                                         java.lang.String translationLastRelease)
                                  throws java.io.IOException
        Consolidates resources and creates a file with the consolidated message keys.
        Parameters:
        outputFile - the output file
        currentTranslatedFile - current german message resources file
        defaultFile - current default message resources file
        translationLastRelease - last sent german message resource file
        Throws:
        java.io.IOException - if any of the properties files is not found
      • printInFile

        private void printInFile​(java.io.File outputFile,
                                 java.util.List<java.lang.String> newKeysList,
                                 java.util.List<java.lang.String> removedKeysList,
                                 java.util.List<java.lang.String> modifiedKeysList,
                                 java.util.List<java.lang.String> sameKeysList)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • mapToSortedList

        private java.util.List<java.lang.String> mapToSortedList​(java.util.Map<java.lang.String,​java.lang.String> map)
      • removeDeletedKeys

        private void removeDeletedKeys​(java.util.Map<java.lang.String,​java.lang.String> newKeysMap,
                                       java.util.Map<java.lang.String,​java.lang.String> removedKeys)
      • getDistinctKeys

        private java.util.Map<java.lang.String,​java.lang.String> getDistinctKeys​(java.util.Properties properties1,
                                                                                       java.util.Properties properties2)
      • getKeysWithDifferentValues

        private java.util.Map<java.lang.String,​java.lang.String> getKeysWithDifferentValues​(java.util.Properties propertiesDe,
                                                                                                  java.util.Properties propertiesSent)
      • getKeysWithSameValues

        private java.util.Map<java.lang.String,​java.lang.String> getKeysWithSameValues​(java.util.Properties propertiesDe,
                                                                                             java.util.Properties propertiesSent)
      • getNewKeysList

        private java.util.Map<java.lang.String,​java.lang.String> getNewKeysList​(java.util.Map<java.lang.String,​java.lang.String> keysInDefaultNotInDe,
                                                                                      java.util.Map<java.lang.String,​java.lang.String> newlyAddedKeysInDe)