Class FileConfigProvider

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ConfigProvider, Configurable

    public class FileConfigProvider
    extends java.lang.Object
    implements ConfigProvider
    An implementation of ConfigProvider that represents a Properties file. All property keys and values are stored as cleartext.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void configure​(java.util.Map<java.lang.String,​?> configs)
      Configure this class with the given key-value pairs
      ConfigData get​(java.lang.String path)
      Retrieves the data at the given Properties file.
      ConfigData get​(java.lang.String path, java.util.Set<java.lang.String> keys)
      Retrieves the data with the given keys at the given Properties file.
      protected java.io.Reader reader​(java.lang.String path)  
      • Methods inherited from class java.lang.Object

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

      • FileConfigProvider

        public FileConfigProvider()
    • Method Detail

      • configure

        public void configure​(java.util.Map<java.lang.String,​?> configs)
        Description copied from interface: Configurable
        Configure this class with the given key-value pairs
        Specified by:
        configure in interface Configurable
      • get

        public ConfigData get​(java.lang.String path)
        Retrieves the data at the given Properties file.
        Specified by:
        get in interface ConfigProvider
        Parameters:
        path - the file where the data resides
        Returns:
        the configuration data
      • get

        public ConfigData get​(java.lang.String path,
                              java.util.Set<java.lang.String> keys)
        Retrieves the data with the given keys at the given Properties file.
        Specified by:
        get in interface ConfigProvider
        Parameters:
        path - the file where the data resides
        keys - the keys whose values will be retrieved
        Returns:
        the configuration data
      • reader

        protected java.io.Reader reader​(java.lang.String path)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable