Package org.eclipse.jgit.lib
Class StoredConfig
java.lang.Object
org.eclipse.jgit.lib.Config
org.eclipse.jgit.lib.StoredConfig
- Direct Known Subclasses:
DfsConfig
,FileBasedConfig
Persistent configuration that can be stored and loaded from a location.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.Config
Config.ConfigEnum, Config.SectionParser<T>
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a configuration with no default fallback.StoredConfig
(Config defaultConfig) Create an empty configuration with a fallback for missing keys. -
Method Summary
Methods inherited from class org.eclipse.jgit.lib.Config
addChangeListener, escapeSubsection, escapeValue, fireConfigChangedEvent, fromText, get, getBaseConfig, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getIntInRange, getIntInRange, getLong, getLong, getNames, getNames, getNames, getNames, getPath, getRawString, getRefSpecs, getSections, getString, getStringList, getSubsections, getTimeUnit, isMissing, isUtf8, notifyUponTransientChanges, readIncludedConfig, setBoolean, setEnum, setInt, setLong, setString, setStringList, setTypedConfigGetter, toText, uncache, unset, unsetSection
-
Constructor Details
-
StoredConfig
public StoredConfig()Create a configuration with no default fallback. -
StoredConfig
Create an empty configuration with a fallback for missing keys.- Parameters:
defaultConfig
- the base configuration to be consulted when a key is missing from this configuration instance.
-
-
Method Details
-
load
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.
- Throws:
IOException
- the configuration could not be read (but does exist).ConfigInvalidException
- the configuration is not properly formatted.
-
save
Save the configuration to the persistent store.- Throws:
IOException
- the configuration could not be written.
-
clear
public void clear()Clear the configuration file
-