public class UploadedFileProcessor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.List<java.lang.String> |
dirsToDelete
Holds names of temporary directories.
|
java.util.Map<java.lang.String,java.lang.String> |
fileNameMap
Short names of uploaded files for each file parameter name.
|
java.util.List<java.lang.String> |
filesToDelete
Holds names of temporary files.
|
boolean |
foundFiles
true if parameters contain all the required files.
|
java.util.Map<java.lang.String,java.lang.String> |
fullFileNameMap
Full path name of each uploaded file for each file parameter name.
|
java.util.Map<java.lang.String,java.lang.String> |
params
Holds request parameter names and values.
|
Constructor and Description |
---|
UploadedFileProcessor(org.restlet.Request request,
java.lang.String[] fileParamNames,
int maxUploadSize)
Create uploaded file processor.
|
UploadedFileProcessor(org.restlet.Request request,
java.lang.String fileParamName,
int maxUploadSize)
Create uploaded file processor when expecting a single file.
|
Modifier and Type | Method and Description |
---|---|
void |
addTempDirectory(java.lang.String dirName)
Add a directory to the list of temporary directories.
|
void |
addTempFile(java.lang.String fileName)
Add a file to the list of temporary file names.
|
void |
deleteTemporaryFilesAndDirectories()
Delete the temporary files and directories.
|
java.lang.String |
getFileName(java.lang.String fieldName)
Get short file name for a parameter.
|
java.lang.String |
getFullFileName(java.lang.String fieldName)
Get full file name for a parameter.
|
java.util.List<java.lang.String> |
getTempDirectories()
Get temporary directories to delete.
|
java.util.List<java.lang.String> |
getTempFiles()
Get temporary files to delete.
|
java.io.File |
getTemporaryDirectory()
Get a temporary directory.
|
public java.util.Map<java.lang.String,java.lang.String> params
public java.util.Map<java.lang.String,java.lang.String> fileNameMap
public java.util.Map<java.lang.String,java.lang.String> fullFileNameMap
public java.util.List<java.lang.String> filesToDelete
public java.util.List<java.lang.String> dirsToDelete
public boolean foundFiles
public UploadedFileProcessor(org.restlet.Request request, java.lang.String[] fileParamNames, int maxUploadSize) throws java.lang.Exception
request
- Servlet request.fileParamNames
- Parameter names of the files to upload.maxUploadSize
- Maximum ize (in bytes) of file to upload.java.lang.Exception
- In case of error.public UploadedFileProcessor(org.restlet.Request request, java.lang.String fileParamName, int maxUploadSize) throws java.lang.Exception
request
- Servlet request.fileParamName
- Parameter name of file upload.maxUploadSize
- Maximum ize (in bytes) of file to upload.java.lang.Exception
- In case of error.public java.io.File getTemporaryDirectory()
public java.lang.String getFileName(java.lang.String fieldName)
fieldName
- The form field name.public java.lang.String getFullFileName(java.lang.String fieldName)
fieldName
- The form field name.public void addTempFile(java.lang.String fileName)
fileName
- File name to add to list of temporary files.public void addTempDirectory(java.lang.String dirName)
dirName
- Directory name to add to list of temporary
directories.public java.util.List<java.lang.String> getTempDirectories()
public java.util.List<java.lang.String> getTempFiles()
public void deleteTemporaryFilesAndDirectories()