eu.planets_project.services.utils.test
Enum FileAccess
java.lang.Object
java.lang.Enum<FileAccess>
eu.planets_project.services.utils.test.FileAccess
- All Implemented Interfaces:
- Serializable, Comparable<FileAccess>
public enum FileAccess
- extends Enum<FileAccess>
Access to test files. Implemented as an enum to provide an ironclad
singleton. Usage: TestFiles.INSTANCE.get("gif")
- Author:
- Fabian Steeg (fabian.steeg@uni-koeln.de)
Method Summary |
File |
get(String extension)
|
static FileAccess |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static FileAccess[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
INSTANCE
public static final FileAccess INSTANCE
values
public static FileAccess[] 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 (FileAccess c : FileAccess.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static FileAccess valueOf(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:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
get
public File get(String extension)
- Parameters:
extension
- The extension of the desired file
- Returns:
- A random file from the test files pool with the given extension,
or null
Copyright © 2013 Open Planets Foundation. All Rights Reserved.