private static final class MockSystemReader.MockConfig extends FileBasedConfig
Config.ConfigEnum, Config.SectionParser<T>
Modifier | Constructor and Description |
---|---|
private |
MockConfig(java.io.File cfgLocation,
FS fs) |
Modifier and Type | Method and Description |
---|---|
boolean |
isOutdated()
Whether the currently loaded configuration file is outdated
|
void |
load()
Load the configuration from the persistent store.
|
void |
save()
Save the configuration to the persistent store.
|
java.lang.String |
toString() |
clear, getFile, notifyUponTransientChanges, readIncludedConfig
addChangeListener, fireConfigChangedEvent, fromText, get, getBaseConfig, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getLong, getLong, getNames, getNames, getNames, getNames, getRefSpecs, getSections, getString, getStringList, getSubsections, getTimeUnit, isMissing, isUtf8, setBoolean, setEnum, setInt, setLong, setString, setStringList, setTypedConfigGetter, toText, uncache, unset, unsetSection
private MockConfig(java.io.File cfgLocation, FS fs)
public void load() throws java.io.IOException, ConfigInvalidException
FileBasedConfig
If the configuration does not exist, this configuration is cleared, and thus behaves the same as though the backing store exists, but is empty.
Load the configuration as a Git text style configuration file.
If the file does not exist, this configuration is cleared, and thus behaves the same as though the file exists, but is empty.
load
in class FileBasedConfig
java.io.IOException
- the configuration could not be read (but does exist).ConfigInvalidException
- the configuration is not properly formatted.public void save() throws java.io.IOException
FileBasedConfig
Save the configuration as a Git text style configuration file.
Warning: Although this method uses the traditional Git file locking approach to protect against concurrent writes of the configuration file, it does not ensure that the file has not been modified since the last read, which means updates performed by other objects accessing the same backing file may be lost.
save
in class FileBasedConfig
java.io.IOException
- the configuration could not be written.public boolean isOutdated()
FileBasedConfig
isOutdated
in class FileBasedConfig
public java.lang.String toString()
FileBasedConfig
toString
in class FileBasedConfig