| Modifier and Type | Field and Description |
|---|---|
| private final File | |
| private AtomicBoolean | |
| private final FS | |
| private volatile ObjectId | |
| private final ReentrantReadWriteLock | |
| private volatile FileSnapshot | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | FileBasedConfig(File
the location of the configuration file on the file system cfgLocation, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)Create a configuration with no default fallback. |
| public | FileBasedConfig(Config
the base configuration file base, File the location of the configuration file on the file system cfgLocation, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)The constructor |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| pack-priv boolean | |
| public final File | Returns: location of the configuration file on diskGet location of the configuration file on disk |
| private static ObjectId | |
| public boolean | Returns: returns true if the currently loaded configuration file is older than the file on diskWhether the currently loaded configuration file is outdated |
| public void | load()
Implements abstract org. Load the configuration from the persistent store. |
| private Boolean | |
| protected boolean | notifyUponTransientChanges()
Overrides org. Determine whether to issue change events for transient changes. |
| protected byte[] | readIncludedConfig(String
possibly relative path to the included config, as specified in
this config relPath)Overrides org. Read the included config from the specified (possibly) relative path |
| public void | save()
Implements abstract org. Save the configuration to the persistent store. |
| public String |
| configFile | back to summary |
|---|---|
| private final File configFile | |
| exists | back to summary |
|---|---|
| private AtomicBoolean exists | |
| fs | back to summary |
|---|---|
| private final FS fs | |
| hash | back to summary |
|---|---|
| private volatile ObjectId hash | |
| lock | back to summary |
|---|---|
| private final ReentrantReadWriteLock lock | |
| snapshot | back to summary |
|---|---|
| private volatile FileSnapshot snapshot | |
| utf8Bom | back to summary |
|---|---|
| private boolean utf8Bom | |
| FileBasedConfig | back to summary |
|---|---|
| public FileBasedConfig(File cfgLocation, FS fs) Create a configuration with no default fallback. | |
| FileBasedConfig | back to summary |
|---|---|
| public FileBasedConfig(Config base, File cfgLocation, FS fs) The constructor | |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Doc from org. Clear the configuration file
| |
| exists | back to summary |
|---|---|
| pack-priv boolean exists() | |
| getFile | back to summary |
|---|---|
| public final File getFile() Get location of the configuration file on disk
| |
| hash | back to summary |
|---|---|
| private static ObjectId hash(byte[] rawText) | |
| isOutdated | back to summary |
|---|---|
| public boolean isOutdated() Whether the currently loaded configuration file is outdated
| |
| load | back to summary |
|---|---|
| public void load() throws IOException, ConfigInvalidException Implements abstract org. Doc from org. 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. 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 | back to summary |
|---|---|
| private Boolean load(File f) throws Exception | |
| notifyUponTransientChanges | back to summary |
|---|---|
| protected boolean notifyUponTransientChanges() Overrides org. Doc from org. Determine whether to issue change events for transient changes.
If
Subclasses that override this to return
| |
| readIncludedConfig | back to summary |
|---|---|
| protected byte[] readIncludedConfig(String relPath) throws ConfigInvalidException Overrides org. Doc from org. Read the included config from the specified (possibly) relative path
| |
| save | back to summary |
|---|---|
| public void save() throws IOException Implements abstract org. Doc from org. Save 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.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |