public class ConfigurationFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfigurationFile.InteractionPolicy
Policy controlling how to deal with the configuration file
|
| Constructor and Description |
|---|
ConfigurationFile(File configurationDir,
String rawName,
String name,
boolean persistOriginal)
Creates a new ConfigurationFile.
|
ConfigurationFile(File configurationDir,
String rawName,
String name,
ConfigurationFile.InteractionPolicy interactionPolicy,
boolean useGit)
Creates a new ConfigurationFile.
|
ConfigurationFile(File configurationDir,
String rawName,
String name,
ConfigurationFile.InteractionPolicy interactionPolicy,
boolean useGit,
File tmpDir)
Creates a new ConfigurationFile.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkCanFindNewBootFile(String bootFileName) |
File |
getBootFile()
Gets the file from which boot operations should be parsed.
|
File |
getConfigurationDir() |
ConfigurationFile.InteractionPolicy |
getInteractionPolicy() |
File |
getMainFile()
Gets the file to which modifications would be persisted, if this object is persisting changes outside the history directory
|
void |
resetBootFile(boolean reloadUsingLast,
String newBootFileName)
Reset so the next call to
getBootFile() will re-determine the appropriate file to use for
parsing boot operations. |
boolean |
useGit() |
public ConfigurationFile(File configurationDir, String rawName, String name, boolean persistOriginal)
configurationDir - directory in which configuration files are stored. Cannot be null and must exist
and be a directoryrawName - default name for configuration files of the type handled by this object.
Cannot be null or an empty stringname - user provided name of the configuration file to usepersistOriginal - true if configuration modifications should be persisted back to the main
configuration file; false if they should only be persisted
to the configuration history directorypublic ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit)
configurationDir - directory in which configuration files are stored. Cannot be null and must exist
and be a directoryrawName - default name for configuration files of the type handled by this object.
Cannot be null or an empty stringname - user provided name of the configuration file to useinteractionPolicy - policy governing interaction with the configuration file.useGit - true if configuration is using Git to manage its history.public ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit, File tmpDir)
configurationDir - directory in which configuration files are stored. Cannot be null and must exist
and be a directory.rawName - default name for configuration files of the type handled by this object.
Cannot be null or an empty string.name - user provided name of the configuration file to use.interactionPolicy - policy governing interaction with the configuration file.useGit - true if configuration is using Git to manage its history.tmpDir - The server temporary directory to use as a fallback if the configuration directory cannot
be written and we are running on read only mode.public boolean useGit()
public boolean checkCanFindNewBootFile(String bootFileName)
public void resetBootFile(boolean reloadUsingLast,
String newBootFileName)
getBootFile() will re-determine the appropriate file to use for
parsing boot operations. If reloadUsingLast is true, while newBootFileName is not null,
newBootFileName will take precedence. If a newBootFileName is used, callers must call
checkCanFindNewBootFile(String) first.reloadUsingLast - true if the next call to getBootFile() should use the last file from
the history. Only relevant if this object is not persisting changes
back to the original source filenewBootFileName - the name of the new bootfilepublic File getBootFile()
nullpublic ConfigurationFile.InteractionPolicy getInteractionPolicy()
public File getMainFile()
public File getConfigurationDir()
Copyright © 2021 JBoss by Red Hat. All rights reserved.