org.loom.resources
Enum WebResourceType

java.lang.Object
  extended by java.lang.Enum<WebResourceType>
      extended by org.loom.resources.WebResourceType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WebResourceType>

public enum WebResourceType
extends java.lang.Enum<WebResourceType>

Type of web resource. If used for a concatenated list of resources, it contains the type of the first identified resource


Enum Constant Summary
CSS
          css file @see ContentTypeNames
JS
          javascript file @see ContentTypeNames
UNKNOWN
          unknown file extension
 
Method Summary
 java.lang.String getContentType()
           
 java.lang.String getExtension()
           
static WebResourceType identify(org.springframework.core.io.Resource resource)
           
static WebResourceType identify(java.lang.String location)
           
static WebResourceType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WebResourceType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

JS

public static final WebResourceType JS
javascript file @see ContentTypeNames


CSS

public static final WebResourceType CSS
css file @see ContentTypeNames


UNKNOWN

public static final WebResourceType UNKNOWN
unknown file extension

Method Detail

values

public static WebResourceType[] 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 (WebResourceType c : WebResourceType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WebResourceType 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 name
java.lang.NullPointerException - if the argument is null

identify

public static WebResourceType identify(org.springframework.core.io.Resource resource)
Returns:
the WebResourceType for the specified location, according to its extension. If the extension is missing or unrecognized, returns UNKNOWN.

identify

public static final WebResourceType identify(java.lang.String location)

getContentType

public java.lang.String getContentType()

getExtension

public java.lang.String getExtension()