Package org.eclipse.jgit.junit
Class MockSystemReader.MockConfig
- java.lang.Object
-
- org.eclipse.jgit.lib.Config
-
- org.eclipse.jgit.lib.StoredConfig
-
- org.eclipse.jgit.storage.file.FileBasedConfig
-
- org.eclipse.jgit.junit.MockSystemReader.MockConfig
-
- Enclosing class:
- MockSystemReader
private static final class MockSystemReader.MockConfig extends FileBasedConfig
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.Config
Config.ConfigEnum, Config.SectionParser<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description privateMockConfig(java.io.File cfgLocation, FS fs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisOutdated()Whether the currently loaded configuration file is outdatedvoidload()Load the configuration from the persistent store.voidsave()Save the configuration to the persistent store.java.lang.StringtoString()-
Methods inherited from class org.eclipse.jgit.storage.file.FileBasedConfig
clear, getFile, notifyUponTransientChanges, readIncludedConfig
-
Methods inherited from class org.eclipse.jgit.lib.Config
addChangeListener, fireConfigChangedEvent, fromText, get, getBaseConfig, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getLong, getLong, getNames, getNames, getNames, getNames, getPath, getRefSpecs, getSections, getString, getStringList, getSubsections, getTimeUnit, isMissing, isUtf8, setBoolean, setEnum, setInt, setLong, setString, setStringList, setTypedConfigGetter, toText, uncache, unset, unsetSection
-
-
-
-
Constructor Detail
-
MockConfig
private MockConfig(java.io.File cfgLocation, FS fs)
-
-
Method Detail
-
load
public void load() throws java.io.IOException, ConfigInvalidExceptionDescription copied from class:FileBasedConfigLoad 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.
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.
- Overrides:
loadin classFileBasedConfig- Throws:
java.io.IOException- the configuration could not be read (but does exist).ConfigInvalidException- the configuration is not properly formatted.
-
save
public void save() throws java.io.IOExceptionDescription copied from class:FileBasedConfigSave the configuration to the persistent store.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.
- Overrides:
savein classFileBasedConfig- Throws:
java.io.IOException- the configuration could not be written.
-
isOutdated
public boolean isOutdated()
Description copied from class:FileBasedConfigWhether the currently loaded configuration file is outdated- Overrides:
isOutdatedin classFileBasedConfig- Returns:
- returns true if the currently loaded configuration file is older than the file on disk
-
toString
public java.lang.String toString()
Description copied from class:FileBasedConfig- Overrides:
toStringin classFileBasedConfig
-
-