Serializable
, Comparable<ConfigLocator>
public enum ConfigLocator extends Enum<ConfigLocator>
File
) and configuration file retrieval as of the chosen configuration
mode.Enum Constant | Description |
---|---|
ABSOLUTE |
None of the as of the folders as of the
ConfigLocator enumeration
are considered. |
ALL |
Representation of folders as of the
ConfigLocator enumeration. |
APPLICATION_ALL |
Representation of all the
APPLICATION_* folders. |
APPLICATION_DIR |
Representation of the folder in which the application resides (e.g. the
`JAR` file).
|
APPLICATION_DIR_ALL |
Representation of all the
APPLICATION_DIR_* folders as of
the ConfigLocator enumeration. |
APPLICATION_DIR_CONFIG |
Representation of the
config folder relative to the folder
in which the application resides (e.g. the `JAR` file). |
APPLICATION_DIR_DOT_CONFIG |
Representation of the
.config folder relative to the folder
in which the application resides (e.g. the `JAR` file). |
APPLICATION_DIR_DOT_ETC |
Representation of the
.etc folder relative to the folder in
which the application resides (e.g. the `JAR` file). |
APPLICATION_DIR_DOT_SETTINGS |
Representation of the
.settings folder relative to the
folder in which the application resides (e.g. the `JAR` file). |
APPLICATION_DIR_ETC |
Representation of the
etc folder relative to the folder in
which the application resides (e.g. the `JAR` file). |
APPLICATION_DIR_SETTINGS |
Representation of the
settings folder relative to the folder
in which the application resides (e.g. the `JAR` file). |
APPLICATION_PARENT_ALL |
Representation of all the
APPLICATION_PARRENT_* folders as
of the ConfigLocator enumeration. |
APPLICATION_PARENT_CONFIG |
Representation of the
config folder in the parent directory
of the folder in which the application resides (e.g. the `JAR` file). |
APPLICATION_PARENT_DOT_CONFIG |
Representation of the
.config folder in the parent directory
of the folder in which the application resides (e.g. the `JAR` file). |
APPLICATION_PARENT_DOT_ETC |
Representation of the
.etc folder in the parent directory of
the folder in which the application resides (e.g. the `JAR` file). |
APPLICATION_PARENT_DOT_SETTINGS |
Representation of the
.settings folder in the parent
directory of the folder in which the application resides (e.g. the `JAR`
file). |
APPLICATION_PARENT_ETC |
Representation of the
etc folder in the parent directory of
the folder in which the application resides (e.g. the `JAR` file). |
APPLICATION_PARENT_SETTINGS |
Representation of the
settings folder in the parent
directory of the folder in which the application resides (e.g. the `JAR`
file). |
HOST_ETC |
Representation of the (in Unix alike systems)
/etc/ folder. |
USER_HOME |
Representation of the executing user's home folder.
|
USER_HOME_ALL |
Representation of all the
USER_HOME_* folders. |
USER_HOME_CONFIG |
Representation of the
config folder relative to the
executing user's home folder. |
USER_HOME_DOT_CONFIG |
Representation of the
.config folder relative to the
executing user's home folder. |
USER_HOME_DOT_ETC |
Representation of the
.etc folder relative to the executing
user's home folder. |
USER_HOME_DOT_SETTINGS |
Representation of the
.settings folder relative to the
executing user's home folder. |
USER_HOME_ETC |
Representation of the
etc folder relative to the executing
user's home folder. |
USER_HOME_SETTINGS |
Representation of the
settings folder relative to the
executing user's home folder. |
USER_WORKING_DIRECTORY |
Modifier and Type | Method | Description |
---|---|---|
File[] |
getFolders() |
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.
|
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 |
isUserHome() |
Determines whether to consider the user's home "~" folder.
|
boolean |
isUserHomeConfig() |
Determines whether to consider the user's home "~" subfolder "config".
|
boolean |
isUserHomeDotConfig() |
Determines whether to consider the user's home "~" subfolder ".config".
|
boolean |
isUserHomeDotEtc() |
Determines whether to consider the user's home "~" subfolder ".etc".
|
boolean |
isUserHomeDotSettings() |
Determines whether to consider the user's home "~" subfolder ".settings".
|
boolean |
isUserHomeEtc() |
Determines whether to consider the user's home "~" subfolder "etc".
|
boolean |
isUserHomeSettings() |
Determines whether to consider the user's home "~" subfolder "settings".
|
boolean |
isUserWorkingDir() |
Determines whether to consider the user's current working directory (as
for example bash's
pwd would print out). |
File |
toFile(String aFileName) |
Retrieves the first
File identified by the given filename located
in one of the according enumeration's configuration locations. |
File |
toFile(String aFileName,
File... aFolders) |
Retrieves the first
File identified by the given filename located
in one of the according enumeration's configuration locations. |
static ConfigLocator |
valueOf(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.
|
public static final ConfigLocator HOST_ETC
/etc/
folder.public static final ConfigLocator APPLICATION_DIR
public static final ConfigLocator APPLICATION_DIR_CONFIG
config
folder relative to the folder
in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_ETC
etc
folder relative to the folder in
which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_SETTINGS
settings
folder relative to the folder
in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_DOT_CONFIG
.config
folder relative to the folder
in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_DOT_ETC
.etc
folder relative to the folder in
which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_DOT_SETTINGS
.settings
folder relative to the
folder in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_DIR_ALL
APPLICATION_DIR_*
folders as of
the ConfigLocator
enumeration.public static final ConfigLocator APPLICATION_PARENT_CONFIG
config
folder in the parent directory
of the folder in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_PARENT_ETC
etc
folder in the parent directory of
the folder in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_PARENT_SETTINGS
settings
folder in the parent
directory of the folder in which the application resides (e.g. the `JAR`
file).public static final ConfigLocator APPLICATION_PARENT_DOT_CONFIG
.config
folder in the parent directory
of the folder in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_PARENT_DOT_ETC
.etc
folder in the parent directory of
the folder in which the application resides (e.g. the `JAR` file).public static final ConfigLocator APPLICATION_PARENT_DOT_SETTINGS
.settings
folder in the parent
directory of the folder in which the application resides (e.g. the `JAR`
file).public static final ConfigLocator APPLICATION_PARENT_ALL
APPLICATION_PARRENT_*
folders as
of the ConfigLocator
enumeration.public static final ConfigLocator APPLICATION_ALL
APPLICATION_*
folders.public static final ConfigLocator USER_HOME
public static final ConfigLocator USER_HOME_CONFIG
config
folder relative to the
executing user's home folder.public static final ConfigLocator USER_HOME_ETC
etc
folder relative to the executing
user's home folder.public static final ConfigLocator USER_HOME_SETTINGS
settings
folder relative to the
executing user's home folder.public static final ConfigLocator USER_HOME_DOT_CONFIG
.config
folder relative to the
executing user's home folder.public static final ConfigLocator USER_HOME_DOT_ETC
.etc
folder relative to the executing
user's home folder.public static final ConfigLocator USER_HOME_DOT_SETTINGS
.settings
folder relative to the
executing user's home folder.public static final ConfigLocator USER_HOME_ALL
USER_HOME_*
folders.public static final ConfigLocator ALL
ConfigLocator
enumeration.public static final ConfigLocator ABSOLUTE
ConfigLocator
enumeration
are considered.public static final ConfigLocator USER_WORKING_DIRECTORY
public static ConfigLocator[] values()
for (ConfigLocator c : ConfigLocator.values()) System.out.println(c);
public static ConfigLocator valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isHostEtc()
public boolean isApplicationBase()
public boolean isApplicationBaseConfig()
public boolean isApplicationBaseEtc()
public boolean isApplicationBaseSettings()
public boolean isApplicationBaseDotConfig()
public boolean isApplicationBaseDotEtc()
public boolean isApplicationBaseDotSettings()
public boolean isApplicationParentConfig()
public boolean isApplicationParentEtc()
public boolean isApplicationParentSettings()
public boolean isApplicationParentDotConfig()
public boolean isApplicationParentDotEtc()
public boolean isApplicationParentDotSettings()
public boolean isUserHome()
public boolean isUserHomeConfig()
public boolean isUserHomeEtc()
public boolean isUserHomeSettings()
public boolean isUserHomeDotConfig()
public boolean isUserHomeDotEtc()
public boolean isUserHomeDotSettings()
public boolean isUserWorkingDir()
pwd
would print out).public File toFile(String aFileName)
File
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 property
SystemProperty.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).public File toFile(String aFileName, File... aFolders)
File
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 property
SystemProperty.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).public File[] getFolders()
SystemProperty.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).public File[] getFolders(File... aFolders)
SystemProperty.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).aFolders
- The folders to also take into account.Copyright © 2021. All rights reserved.