- All Implemented Interfaces:
Serializable,Comparable<ConfigLocator>,Constable
This enumeration represents configuration folder locations (of type
File) and configuration file retrieval as of the chosen configuration
mode.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNone of the as of the folders as of theConfigLocatorenumeration are considered.Representation of folders as of theConfigLocatorenumeration.Representation of all theAPPLICATION_*folders.Representation of the folder in which the application resides (e.g. the `JAR` file).Representation of all theAPPLICATION_DIR_*folders as of theConfigLocatorenumeration.Representation of theconfigfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of the.configfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of the.etcfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of the.settingsfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of theetcfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of thesettingsfolder relative to the folder in which the application resides (e.g. the `JAR` file).Representation of all theAPPLICATION_PARRENT_*folders as of theConfigLocatorenumeration.Representation of theconfigfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Representation of the.configfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Representation of the.etcfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Representation of the.settingsfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Representation of theetcfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Representation of thesettingsfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file).Any ofUSER_WORKING_DIRECTORY,APPLICATION_DIR,APPLICATION_DIR_SETTINGS,APPLICATION_DIR_ETC,APPLICATION_DIR_CONFIG,USER_HOME_DOT_CONFIGorHOST_ETCin this precedence.Representation of the (in Unix alike systems)/etc/folder.Representation of the executing user's home folder.Representation of all theUSER_HOME_*folders.Representation of theconfigfolder relative to the executing user's home folder.Representation of the.configfolder relative to the executing user's home folder.Representation of the.etcfolder relative to the executing user's home folder.Representation of the.settingsfolder relative to the executing user's home folder.Representation of theetcfolder relative to the executing user's home folder.Representation of thesettingsfolder relative to the executing user's home folder.Representation of all theUSER_HOME_*folders as well as the current user's current working directoryUSER_WORKING_DIRECTORY.Consider just the current user's current working directory. -
Method Summary
Modifier and TypeMethodDescriptionFile[]Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation.File[]getFolders(File... aFolders) Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation.booleanDetermines whether to consider the application's base (the folder where the JAR resides) folder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) "config" subfolder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) ".config" subfolder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) ".etc" subfolder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) ".settings" subfolder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) "etc" subfolder.booleanDetermines whether to consider the application's base (the folder where the JAR resides) "settings" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "config" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".config" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".etc" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".settings" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "etc" subfolder.booleanDetermines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "settings" subfolder.booleanDetermines whether to consider the host's "/etc" folder.booleanDetermines whether to consider the user's home "~" folder.booleanDetermines whether to consider the user's home "~" subfolder "config".booleanDetermines whether to consider the user's home "~" subfolder ".config".booleanDetermines whether to consider the user's home "~" subfolder ".etc".booleanDetermines whether to consider the user's home "~" subfolder ".settings".booleanDetermines whether to consider the user's home "~" subfolder "etc".booleanDetermines whether to consider the user's home "~" subfolder "settings".booleanDetermines whether to consider the user's current working directory (as for example bash'spwdwould print out).Retrieves the firstFileidentified by the given filename located in one of the according enumeration's configuration locations.Retrieves the firstFileidentified by the given filename located in one of the according enumeration's configuration locations.static ConfigLocatorReturns the enum constant of this class with the specified name.static ConfigLocator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Any ofUSER_WORKING_DIRECTORY,APPLICATION_DIR,APPLICATION_DIR_SETTINGS,APPLICATION_DIR_ETC,APPLICATION_DIR_CONFIG,USER_HOME_DOT_CONFIGorHOST_ETCin this precedence. -
HOST_ETC
Representation of the (in Unix alike systems)/etc/folder. -
APPLICATION_DIR
Representation of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_CONFIG
Representation of theconfigfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_ETC
Representation of theetcfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_SETTINGS
Representation of thesettingsfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_DOT_CONFIG
Representation of the.configfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_DOT_ETC
Representation of the.etcfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_DOT_SETTINGS
Representation of the.settingsfolder relative to the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_DIR_ALL
Representation of all theAPPLICATION_DIR_*folders as of theConfigLocatorenumeration. -
APPLICATION_PARENT_CONFIG
Representation of theconfigfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_ETC
Representation of theetcfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_SETTINGS
Representation of thesettingsfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_DOT_CONFIG
Representation of the.configfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_DOT_ETC
Representation of the.etcfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_DOT_SETTINGS
Representation of the.settingsfolder in the parent directory of the folder in which the application resides (e.g. the `JAR` file). -
APPLICATION_PARENT_ALL
Representation of all theAPPLICATION_PARRENT_*folders as of theConfigLocatorenumeration. -
APPLICATION_ALL
Representation of all theAPPLICATION_*folders. -
USER_HOME
Representation of the executing user's home folder. -
USER_HOME_CONFIG
Representation of theconfigfolder relative to the executing user's home folder. -
USER_HOME_ETC
Representation of theetcfolder relative to the executing user's home folder. -
USER_HOME_SETTINGS
Representation of thesettingsfolder relative to the executing user's home folder. -
USER_HOME_DOT_CONFIG
Representation of the.configfolder relative to the executing user's home folder. -
USER_HOME_DOT_ETC
Representation of the.etcfolder relative to the executing user's home folder. -
USER_HOME_DOT_SETTINGS
Representation of the.settingsfolder relative to the executing user's home folder. -
USER_HOME_ALL
Representation of all theUSER_HOME_*folders. -
USER_WORKING_DIRECTORY
Consider just the current user's current working directory. -
USER_HOME_WORKING_DIRECTORY_ALL
Representation of all theUSER_HOME_*folders as well as the current user's current working directoryUSER_WORKING_DIRECTORY. -
ALL
Representation of folders as of theConfigLocatorenumeration. -
ABSOLUTE
None of the as of the folders as of theConfigLocatorenumeration are considered.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isHostEtc
public boolean isHostEtc()Determines whether to consider the host's "/etc" folder.- Returns:
- True in case the according folder is considered.
-
isApplicationBase
public boolean isApplicationBase()Determines whether to consider the application's base (the folder where the JAR resides) folder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseConfig
public boolean isApplicationBaseConfig()Determines whether to consider the application's base (the folder where the JAR resides) "config" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseEtc
public boolean isApplicationBaseEtc()Determines whether to consider the application's base (the folder where the JAR resides) "etc" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseSettings
public boolean isApplicationBaseSettings()Determines whether to consider the application's base (the folder where the JAR resides) "settings" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseDotConfig
public boolean isApplicationBaseDotConfig()Determines whether to consider the application's base (the folder where the JAR resides) ".config" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseDotEtc
public boolean isApplicationBaseDotEtc()Determines whether to consider the application's base (the folder where the JAR resides) ".etc" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationBaseDotSettings
public boolean isApplicationBaseDotSettings()Determines whether to consider the application's base (the folder where the JAR resides) ".settings" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentConfig
public boolean isApplicationParentConfig()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "config" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentEtc
public boolean isApplicationParentEtc()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "etc" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentSettings
public boolean isApplicationParentSettings()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "settings" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentDotConfig
public boolean isApplicationParentDotConfig()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".config" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentDotEtc
public boolean isApplicationParentDotEtc()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".etc" subfolder.- Returns:
- True in case the according folder is considered.
-
isApplicationParentDotSettings
public boolean isApplicationParentDotSettings()Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".settings" subfolder.- Returns:
- True in case the according folder is considered.
-
isUserHome
public boolean isUserHome()Determines whether to consider the user's home "~" folder.- Returns:
- True in case the according folder is considered.
-
isUserHomeConfig
public boolean isUserHomeConfig()Determines whether to consider the user's home "~" subfolder "config".- Returns:
- True in case the according folder is considered.
-
isUserHomeEtc
public boolean isUserHomeEtc()Determines whether to consider the user's home "~" subfolder "etc".- Returns:
- True in case the according folder is considered.
-
isUserHomeSettings
public boolean isUserHomeSettings()Determines whether to consider the user's home "~" subfolder "settings".- Returns:
- True in case the according folder is considered.
-
isUserHomeDotConfig
public boolean isUserHomeDotConfig()Determines whether to consider the user's home "~" subfolder ".config".- Returns:
- True in case the according folder is considered.
-
isUserHomeDotEtc
public boolean isUserHomeDotEtc()Determines whether to consider the user's home "~" subfolder ".etc".- Returns:
- True in case the according folder is considered.
-
isUserHomeDotSettings
public boolean isUserHomeDotSettings()Determines whether to consider the user's home "~" subfolder ".settings".- Returns:
- True in case the according folder is considered.
-
isUserWorkingDir
public boolean isUserWorkingDir()Determines whether to consider the user's current working directory (as for example bash'spwdwould print out).- Returns:
- True in case the according folder is considered.
-
toFile
Retrieves the firstFileidentified by the given filename located in one of the according enumeration's configuration locations. If provided, regards the folder as provided by the system propertySystemProperty.CONFIG_DIRwith highest priority. Also takes build environment folders into account (least highest priority) when the launch folder points to an according build environment (such as maven's "target" folder). -
toFile
Retrieves the firstFileidentified by the given filename located in one of the according enumeration's configuration locations. If provided, regards the folder as provided by the system propertySystemProperty.CONFIG_DIRwith highest priority. The programmatically provided folders are regarded with second highest priority. Also takes build environment folders into account (least highest priority) when the launch folder points to an according build environment (such as maven's "target" folder). -
getFolders
Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation. If provided, regards the folder as provided by the system propertySystemProperty.CONFIG_DIRwith highest priority. Also takes build environment folders into account (least highest priority) when the launch folder points to an according build environment (such as maven's "target" folder).- Returns:
- The folders to be examined.
-
getFolders
Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation. If provided, regards the folder as provided by the system propertySystemProperty.CONFIG_DIRwith highest priority. The programmatically provided folders are regarded with second highest priority. Also takes build environment folders into account (least highest priority) when the launch folder points to an according build environment (such as maven's "target" folder).- Parameters:
aFolders- The folders to also take into account.- Returns:
- The folders to be examined.
-