net.fckeditor.handlers
Class Command

java.lang.Object
  extended by net.fckeditor.handlers.Command

public class Command
extends Object

File Browser GET and POST commands.
The File Browser sends a specific command for each and every request. This class is intended to reflect these in an Enum-like manner.

The commands are for GET:

and for POST:

Version:
$Id: Command.java 4785 2009-12-21 20:10:28Z mosipov $

Field Summary
static Command CREATE_FOLDER
          GET command CreateFolder
static Command FILE_UPLOAD
          POST command FileUpload
static Command GET_FOLDERS
          GET command GetFolders
static Command GET_FOLDERS_AND_FILES
          GET command GetFoldersAndFiles
static Command QUICK_UPLOAD
          POST command QuickUpload
 
Method Summary
 boolean equals(Object obj)
          Compares the specified object with this command for equality.
static Command getCommand(String name)
          Returns the command constant with the specified name.
 String getName()
          Returns the name of this command.
 int hashCode()
          Returns the hash code value for this command.
static boolean isValidForGet(String name)
          Returns true if name represents a valid GET command constant.
static boolean isValidForPost(String name)
          Returns true if name represents a valid POST command constant.
 String toString()
          Returns a string representation of this command.
static Command valueOf(String name)
          Returns the command constant with the specified name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GET_FOLDERS

public static final Command GET_FOLDERS
GET command GetFolders


GET_FOLDERS_AND_FILES

public static final Command GET_FOLDERS_AND_FILES
GET command GetFoldersAndFiles


CREATE_FOLDER

public static final Command CREATE_FOLDER
GET command CreateFolder


FILE_UPLOAD

public static final Command FILE_UPLOAD
POST command FileUpload


QUICK_UPLOAD

public static final Command QUICK_UPLOAD
POST command QuickUpload

Method Detail

getName

public String getName()
Returns the name of this command.

Returns:
the name of this command

valueOf

public static Command valueOf(String name)
Returns the command constant with the specified name.

Parameters:
name - the name of the constant to return
Returns:
the command constant with the specified name
Throws:
IllegalArgumentException - if this class has no constant with the specified name
NullPointerException - if name is null or empty

isValidForGet

public static boolean isValidForGet(String name)
Returns true if name represents a valid GET command constant.

Parameters:
name - the command to check
Returns:
true if name represents a valid command, else false

isValidForPost

public static boolean isValidForPost(String name)
Returns true if name represents a valid POST command constant.

Parameters:
name - the command to check
Returns:
true if name represents a valid command, else false

getCommand

public static Command getCommand(String name)
Returns the command constant with the specified name. In contrast to valueOf(String) it returns a null instead of throwing an exception if a command constant was not found.

Parameters:
name - the name of the constant to return
Returns:
the command constant with the specified name, else null

equals

public boolean equals(Object obj)
Compares the specified object with this command for equality. The comparison is based on class and name only.

Overrides:
equals in class Object
Parameters:
obj - Object to be compared with this command.
Returns:
true if the specified object is equal to this command

hashCode

public int hashCode()
Returns the hash code value for this command. The hash code equals the hash code of the name field.

Overrides:
hashCode in class Object
Returns:
the hash code value for this command

toString

public String toString()
Returns a string representation of this command.

Overrides:
toString in class Object
Returns:
a string representation of this command
See Also:
getName()


Copyright © 2004-2010 Frederico Caldeira Knabben. All Rights Reserved.