Package org.moeaframework.util.io
Enum Class Resources.ResourceOption
- All Implemented Interfaces:
Serializable
,Comparable<Resources.ResourceOption>
,Constable
- Enclosing class:
- Resources
Options used when locating and extracting resources.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSet the executable flag on the file if being extracted.First search for a file referenced by the resource path.The resource is required and aResourceNotFoundException
is thrown if the resource could not be found.Extracts the resource to a temporary file instead of the path referenced by the resource. -
Method Summary
Modifier and TypeMethodDescriptionstatic Resources.ResourceOption
Returns the enum constant of this class with the specified name.static Resources.ResourceOption[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FILE
First search for a file referenced by the resource path. Any leading"/"
in the resource path, which is typically used to indicate the resource path is absolute (starting at the root of the classpath), is ignored when locating the file. The file will be resolved relative to the base directory. -
TEMPORARY
Extracts the resource to a temporary file instead of the path referenced by the resource. This option is only used byResources.asFile(Class, String, ResourceOption...)
. -
EXECUTABLE
Set the executable flag on the file if being extracted. This option is only used byResources.asFile(Class, String, ResourceOption...)
. -
REQUIRED
The resource is required and aResourceNotFoundException
is thrown if the resource could not be found. There is no need to check fornull
return values when using this option.
-
-
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
-