Class StoredConfig

  • Direct Known Subclasses:
    DfsConfig, FileBasedConfig

    public abstract class StoredConfig
    extends Config
    Persistent configuration that can be stored and loaded from a location.
    • Constructor Detail

      • StoredConfig

        public StoredConfig()
        Create a configuration with no default fallback.
      • StoredConfig

        public StoredConfig​(Config defaultConfig)
        Create an empty configuration with a fallback for missing keys.
        defaultConfig - the base configuration to be consulted when a key is missing from this configuration instance.
    • Method Detail

      • load

        public abstract void load()
                           throws IOException,
        Load the configuration from the persistent store.

        If the configuration does not exist, this configuration is cleared, and thus behaves the same as though the backing store exists, but is empty.

        IOException - the configuration could not be read (but does exist).
        ConfigInvalidException - the configuration is not properly formatted.
      • save

        public abstract void save()
                           throws IOException
        Save the configuration to the persistent store.
        IOException - the configuration could not be written.
      • clear

        public void clear()
        Clear the configuration file
        clear in class Config