Package org.appng.api.model
Enum ResourceType
- java.lang.Object
-
- java.lang.Enum<ResourceType>
-
- org.appng.api.model.ResourceType
-
- All Implemented Interfaces:
FilenameFilter
,Serializable
,Comparable<ResourceType>
public enum ResourceType extends Enum<ResourceType> implements FilenameFilter
Defines the different types of aResource
.- Author:
- Matthias Herlitzius
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPLICATION
TheApplication
'sapplication.xml
located in the root directoryASSET
not yet supportedBEANS_XML
TheApplication
'sbeans.xml
located in the root directoryDICTIONARY
JAR
RESOURCE
TheApplication
s custom resources, such as .js, .css, .jpg, .pngSQL
TPL
TheApplication
s custom (non-XSL) template resourcesXML
XSL
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_XML_NAME
static String
BEANS_XML_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File dir, String name)
Set<String>
getAllowedFileEndings()
Returns an immutable set of all allowed file-endings (without '.')String
getFolder()
Returns the relative path for this type.boolean
isValidFileEnding(String fileEnding)
Checks whether the given file-ending is valid for this type.boolean
isValidFileName(String fileName)
Checks whether the given file-name is valid for this type.boolean
supportsSubfolders()
Checks whether this type supports subfolders.static ResourceType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResourceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BEANS_XML
public static final ResourceType BEANS_XML
TheApplication
'sbeans.xml
located in the root directory
-
JAR
public static final ResourceType JAR
-
XML
public static final ResourceType XML
-
XSL
public static final ResourceType XSL
-
SQL
public static final ResourceType SQL
-
TPL
public static final ResourceType TPL
TheApplication
s custom (non-XSL) template resources
-
RESOURCE
public static final ResourceType RESOURCE
TheApplication
s custom resources, such as .js, .css, .jpg, .png
-
ASSET
public static final ResourceType ASSET
not yet supported
-
DICTIONARY
public static final ResourceType DICTIONARY
-
APPLICATION
public static final ResourceType APPLICATION
TheApplication
'sapplication.xml
located in the root directory
-
-
Field Detail
-
BEANS_XML_NAME
public static final String BEANS_XML_NAME
- See Also:
- Constant Field Values
-
APPLICATION_XML_NAME
public static final String APPLICATION_XML_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static ResourceType[] 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 (ResourceType c : ResourceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResourceType 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 nameNullPointerException
- if the argument is null
-
getFolder
public String getFolder()
Returns the relative path for this type.- Returns:
- the relative path
-
supportsSubfolders
public boolean supportsSubfolders()
Checks whether this type supports subfolders.- Returns:
true
if this type supports subfolder,false
otherwise
-
isValidFileEnding
public boolean isValidFileEnding(String fileEnding)
Checks whether the given file-ending is valid for this type.- Parameters:
fileEnding
- a file-ending, without '.'- Returns:
true
if the given file-ending is valid for this type,false
otherwise
-
isValidFileName
public boolean isValidFileName(String fileName)
Checks whether the given file-name is valid for this type.- Parameters:
fileName
- the name of the file- Returns:
true
if the given file-name is valid for this type,false
otherwise
-
getAllowedFileEndings
public Set<String> getAllowedFileEndings()
Returns an immutable set of all allowed file-endings (without '.')- Returns:
- a set of all allowed file-endings. An empty set means all file types are allowed.
-
accept
public boolean accept(File dir, String name)
- Specified by:
accept
in interfaceFilenameFilter
-
-