Package org.refcodes.runtime
Enum ConfigLocator
- java.lang.Object
-
- java.lang.Enum<ConfigLocator>
-
- org.refcodes.runtime.ConfigLocator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ConfigLocator>
public enum ConfigLocator extends java.lang.Enum<ConfigLocator>
This enumeration represents configuration folder locations (of typeFile
) and configuration file retrieval as of the chosen configuration mode.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File[]
getFolders()
Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation.java.io.File[]
getFolders(java.io.File... aFolders)
Returns the folders to be examined by the according enumeration's configuration in the order as of evaluation.boolean
isApplicationBase()
Determines whether to consider the application's base (the folder where the JAR resides) folder.boolean
isApplicationBaseConfig()
Determines whether to consider the application's base (the folder where the JAR resides) "config" subfolder.boolean
isApplicationBaseDotConfig()
Determines whether to consider the application's base (the folder where the JAR resides) ".config" subfolder.boolean
isApplicationBaseDotEtc()
Determines whether to consider the application's base (the folder where the JAR resides) ".etc" subfolder.boolean
isApplicationBaseDotSettings()
Determines whether to consider the application's base (the folder where the JAR resides) ".settings" subfolder.boolean
isApplicationBaseEtc()
Determines whether to consider the application's base (the folder where the JAR resides) "etc" subfolder.boolean
isApplicationBaseSettings()
Determines whether to consider the application's base (the folder where the JAR resides) "settings" subfolder.boolean
isApplicationParentConfig()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "config" subfolder.boolean
isApplicationParentDotConfig()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".config" subfolder.boolean
isApplicationParentDotEtc()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".etc" subfolder.boolean
isApplicationParentDotSettings()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) ".settings" subfolder.boolean
isApplicationParentEtc()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "etc" subfolder.boolean
isApplicationParentSettings()
Determines whether to consider the application's parent (the parent folder of the folder where the JAR resides) "settings" subfolder.boolean
isHostEtc()
Determines whether to consider the host's "/etc" folder.boolean
isUser()
Determines whether to consider the user's home "~" folder.boolean
isUserConfig()
Determines whether to consider the user's home "~" subfolder "config".boolean
isUserDotConfig()
Determines whether to consider the user's home "~" subfolder ".config".boolean
isUserDotEtc()
Determines whether to consider the user's home "~" subfolder ".etc".boolean
isUserDotSettings()
Determines whether to consider the user's home "~" subfolder ".settings".boolean
isUserEtc()
Determines whether to consider the user's home "~" subfolder "etc".boolean
isUserSettings()
Determines whether to consider the user's home "~" subfolder "settings".java.io.File
toFile(java.lang.String aFileName)
Retrieves the firstFile
identified by the given filename located in one of the according enumeration's configuration locations.java.io.File
toFile(java.lang.String aFileName, java.io.File... aFolders)
Retrieves the firstFile
identified by the given filename located in one of the according enumeration's configuration locations.static ConfigLocator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ConfigLocator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HOST_ETC
public static final ConfigLocator HOST_ETC
-
APPLICATION_BASE
public static final ConfigLocator APPLICATION_BASE
-
APPLICATION_BASE_CONFIG
public static final ConfigLocator APPLICATION_BASE_CONFIG
-
APPLICATION_BASE_ETC
public static final ConfigLocator APPLICATION_BASE_ETC
-
APPLICATION_BASE_SETTINGS
public static final ConfigLocator APPLICATION_BASE_SETTINGS
-
APPLICATION_BASE_DOT_CONFIG
public static final ConfigLocator APPLICATION_BASE_DOT_CONFIG
-
APPLICATION_BASE_DOT_ETC
public static final ConfigLocator APPLICATION_BASE_DOT_ETC
-
APPLICATION_BASE_DOT_SETTINGS
public static final ConfigLocator APPLICATION_BASE_DOT_SETTINGS
-
APPLICATION_BASE_ALL
public static final ConfigLocator APPLICATION_BASE_ALL
-
APPLICATION_PARENT_CONFIG
public static final ConfigLocator APPLICATION_PARENT_CONFIG
-
APPLICATION_PARENT_ETC
public static final ConfigLocator APPLICATION_PARENT_ETC
-
APPLICATION_PARENT_SETTINGS
public static final ConfigLocator APPLICATION_PARENT_SETTINGS
-
APPLICATION_PARENT_DOT_CONFIG
public static final ConfigLocator APPLICATION_PARENT_DOT_CONFIG
-
APPLICATION_PARENT_DOT_ETC
public static final ConfigLocator APPLICATION_PARENT_DOT_ETC
-
APPLICATION_PARENT_DOT_SETTINGS
public static final ConfigLocator APPLICATION_PARENT_DOT_SETTINGS
-
APPLICATION_PARENT_ALL
public static final ConfigLocator APPLICATION_PARENT_ALL
-
APPLICATION_ALL
public static final ConfigLocator APPLICATION_ALL
-
USER
public static final ConfigLocator USER
-
USER_CONFIG
public static final ConfigLocator USER_CONFIG
-
USER_ETC
public static final ConfigLocator USER_ETC
-
USER_SETTINGS
public static final ConfigLocator USER_SETTINGS
-
USER_DOT_CONFIG
public static final ConfigLocator USER_DOT_CONFIG
-
USER_DOT_ETC
public static final ConfigLocator USER_DOT_ETC
-
USER_DOT_SETTINGS
public static final ConfigLocator USER_DOT_SETTINGS
-
USER_ALL
public static final ConfigLocator USER_ALL
-
ALL
public static final ConfigLocator ALL
-
SKIP
public static final ConfigLocator SKIP
-
-
Method Detail
-
values
public static ConfigLocator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConfigLocator c : ConfigLocator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConfigLocator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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.
-
isUser
public boolean isUser()
Determines whether to consider the user's home "~" folder.- Returns:
- True in case the according folder is considered.
-
isUserConfig
public boolean isUserConfig()
Determines whether to consider the user's home "~" subfolder "config".- Returns:
- True in case the according folder is considered.
-
isUserEtc
public boolean isUserEtc()
Determines whether to consider the user's home "~" subfolder "etc".- Returns:
- True in case the according folder is considered.
-
isUserSettings
public boolean isUserSettings()
Determines whether to consider the user's home "~" subfolder "settings".- Returns:
- True in case the according folder is considered.
-
isUserDotConfig
public boolean isUserDotConfig()
Determines whether to consider the user's home "~" subfolder ".config".- Returns:
- True in case the according folder is considered.
-
isUserDotEtc
public boolean isUserDotEtc()
Determines whether to consider the user's home "~" subfolder ".etc".- Returns:
- True in case the according folder is considered.
-
isUserDotSettings
public boolean isUserDotSettings()
Determines whether to consider the user's home "~" subfolder ".settings".- Returns:
- True in case the according folder is considered.
-
toFile
public java.io.File toFile(java.lang.String aFileName)
Retrieves the firstFile
identified 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_DIR
with 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:
aFileName
- The filename for which to determine the accordingFile
.- Returns:
- The according
File
or null if none such file was detected.
-
toFile
public java.io.File toFile(java.lang.String aFileName, java.io.File... aFolders)
Retrieves the firstFile
identified 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_DIR
with 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:
aFileName
- The filename for which to determine the accordingFile
.aFolders
- The folders to also take into account.- Returns:
- The according
File
or null if none such file was detected.
-
getFolders
public java.io.File[] 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_DIR
with 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
public java.io.File[] getFolders(java.io.File... aFolders)
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_DIR
with 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.
-
-