|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.fckeditor.handlers.ResourceType
public class ResourceType
File Browser resource types. The File Browser provides a specific resource type for each and every request. This class is intended to reflect these in an Enum-like manner.
The resource types are:
Field Summary | |
---|---|
static ResourceType |
FILE
Resource type File |
static ResourceType |
FLASH
Resource type Flash |
static ResourceType |
IMAGE
Resource type Image |
static ResourceType |
MEDIA
Resource type Media |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compares the specified object with this resource type for equality. |
Set<String> |
getAllowedEextensions()
Returns a read-only reference to the allowed extensions set. |
static ResourceType |
getDefaultResourceType(String name)
Returns the resource type constant with the specified name. |
Set<String> |
getDeniedExtensions()
Returns a read-only reference to the denied extensions set. |
String |
getName()
Returns the name of this resource type. |
String |
getPath()
Returns the absolute path of this resource type. |
static ResourceType |
getResourceType(String name)
Returns the resource type constant with the specified name. |
int |
hashCode()
Returns the hash code value for this resource type. |
boolean |
isAllowedExtension(String extension)
Returns true if extension is allowed. |
boolean |
isDeniedExtension(String extension)
Returns true if extension is denied. |
static boolean |
isValidType(String name)
Returns true if name represents a valid resource type
constant. |
static ResourceType |
valueOf(String name)
Returns the resource type constant with the specified name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ResourceType FILE
File
public static final ResourceType FLASH
Flash
public static final ResourceType IMAGE
Image
public static final ResourceType MEDIA
Media
Method Detail |
---|
public String getName()
public String getPath()
public Set<String> getAllowedEextensions()
public Set<String> getDeniedExtensions()
public static ResourceType valueOf(String name)
name
- the name of the constant to return
IllegalArgumentException
- if this class has no constant with the specified name
NullPointerException
- if name
is null or emptypublic static boolean isValidType(String name)
true
if name represents a valid resource type
constant.
name
- the resource type to check
true
if name represents a valid resource type, else
false
public static ResourceType getResourceType(String name)
valueOf(String)
it returns a null instead of throwing an
exception if a resource type constant was not found.
name
- the name of the constant to return
null
public static ResourceType getDefaultResourceType(String name)
getResourceType(String)
it returns FILE
instead of
returning null
.
name
- the name of the constant to return
FILE
public boolean isAllowedExtension(String extension)
true
if extension is allowed. Denied extensions set
takes precedence over allowed extensions set, in other words a negative
check is made against denied set and if this fails, allowed set is
checked.
extension
- the extension to check, empty will fail
true
if extension is allowed, else
false
public boolean isDeniedExtension(String extension)
true
if extension is denied. This method simply
negates isAllowedExtension(String)
.
extension
- the extension to check, empty will fail
true
if extension is denied, else false
public boolean equals(Object obj)
equals
in class Object
obj
- Object to be compared with this resource type.
true
if the specified object is equal to this
resource typepublic int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |