|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.services.model.StandardModel
org.keel.services.model.StandardLogEnabledModel
org.keel.services.model.SecurableStandardLogEnabledModel
org.keel.apps.fileservices.model.FileManageModel
This model provides the basic File Management services for Keel. The services provided are;
COPY
MOVE
DELETE
MKDIR
RMDIR
This class is securable, so as to not allow users to be able to randomly access and manipulate files on the system. BEWARE WHAT ACCESS LEVELS YOU GRANT TO WHAT USER!
| Field Summary | |
static java.lang.String |
COMMANDThe Parameter Key for the command to execute. |
static java.lang.String |
COPYThe command for copy files. |
static java.lang.String |
DELETEThe command to delete a file. |
static java.lang.String |
DELETE_CONTENTSThe parameter key for whether the contents should be deleted when deleting the current directory |
static java.lang.String |
DESTINATION_KEYThe Parameter Key for the Destination file/filename |
static java.lang.String |
MAKE_PARENTSThe parameter key for whether the parent directories should be made |
static java.lang.String |
MKDIRThe command to make a directory |
static java.lang.String |
MOVEThe command to move a file. |
static java.lang.String |
RMDIRThe command to delete a directory |
static java.lang.String |
SOURCE_KEYThe Parameter Key for the Source file/filename |
| Fields inherited from class org.keel.services.model.SecurableStandardLogEnabledModel |
|
| Fields inherited from class org.keel.services.model.StandardLogEnabledModel |
log |
| Fields inherited from class org.keel.services.model.StandardModel |
configuration |
| Fields inherited from interface org.keel.services.model.Model |
ROLE |
| Constructor Summary | |
FileManageModel() |
|
| Method Summary | |
protected ModelResponse |
copy(ModelRequest req, ModelResponse res)Copies a file from source to destination. |
protected ModelResponse |
delete(ModelRequest req, ModelResponse res)Deletes the specified file. |
ModelResponse |
execute(ModelRequest request)Executes the FileManage Request |
protected File |
getFileFromRequest(ModelRequest req, java.lang.String key, java.lang.String errorKey)Gets the File object at the requested key from the request object. |
protected ModelResponse |
mkdir(ModelRequest req, ModelResponse res)Makes a new directory/volume/set, depending on the FileType. |
protected ModelResponse |
move(ModelRequest req, ModelResponse res)Move a file from one location to another |
protected ModelResponse |
rmdir(ModelRequest req, ModelResponse res)Removes the directory specified in the Request's "source" parameter. |
| Methods inherited from class org.keel.services.model.SecurableStandardLogEnabledModel |
getAuthorizationManager, setAuthorizationManager |
| Methods inherited from class org.keel.services.model.StandardLogEnabledModel |
enableLogging |
| Methods inherited from class org.keel.services.model.StandardModel |
configure, getConfiguration |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String COMMAND
public static final java.lang.String COPY
public static final java.lang.String MOVE
public static final java.lang.String DELETE
public static final java.lang.String MKDIR
public static final java.lang.String RMDIR
public static final java.lang.String SOURCE_KEY
public static final java.lang.String DESTINATION_KEY
public static final java.lang.String MAKE_PARENTS
public static final java.lang.String DELETE_CONTENTS
| Constructor Detail |
public FileManageModel()
| Method Detail |
public ModelResponse execute(ModelRequest request)
throws ModelException
request - The command to execute, as well as any needed parametersModelException - Thrown if a severe error occurs processing the request. Also thrown if command is not understood/valid.Model.execute(org.keel.services.model.ModelRequest)
protected ModelResponse copy(ModelRequest req,
ModelResponse res)
req - The request containing the copy command and needed parametersres - The response to add any error messages toFile.copyTo(org.keel.apps.fileservices.File)
protected ModelResponse move(ModelRequest req,
ModelResponse res)
req - The request containing the move command and needed parametersres - The response to add any error messages toFile.moveTo(org.keel.apps.fileservices.File)
protected ModelResponse delete(ModelRequest req,
ModelResponse res)
req - The request containing the delete command, and the file to deleteres - The response to add any error messages toorg.keel.apps.fileservices.File#delete()
protected ModelResponse mkdir(ModelRequest req,
ModelResponse res)
req - The request containing the delete command, and the file to deleteres - The response to add any error messages toorg.keel.apps.fileservices.File#mkdir()
protected ModelResponse rmdir(ModelRequest req,
ModelResponse res)
req - The request containing the delete command, and the file to deleteres - The response to add any error messages to
protected File getFileFromRequest(ModelRequest req,
java.lang.String key,
java.lang.String errorKey)
throws ModelException
req - The ModelRequest containing the key/value pair as a parameterkey - The Key for the File valueerrorKey - The Key for the error message if the parameter is not found.ModelException - Thrown if no value at specified key.
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||