Class PropertiesFileReader

java.lang.Object
org.codice.ddf.platform.util.properties.PropertiesFileReader

public class PropertiesFileReader extends Object
Useful for scanning a directory for properties files and aggregating the data into maps and lists.
  • Constructor Details

    • PropertiesFileReader

      public PropertiesFileReader()
  • Method Details

    • loadPropertiesFilesInDirectory

      public List<Map<String,String>> loadPropertiesFilesInDirectory(String directoryPath)
      Deserializes all on-disk properties files in the given directory into a list of maps.
      Parameters:
      directoryPath - the path to the directory of properties files
      Returns:
      a list of maps holding the values of the properties files in the directory the given path pointed at, which can be empty if no properties were found.
    • loadSinglePropertiesFile

      public Map<String,String> loadSinglePropertiesFile(String filePath)
      Deserializes an on-disk properties file into a map.
      Parameters:
      filePath - the path to the file of properties
      Returns:
      a map of the values in the properties file the provided path pointed at, which can be empty if no properties were found.