|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UploadedFileProcessor
Interface responsible for processing file uploads. An Apache Trinidad
application has a single UploadedFileProcessor
instance.
It is accessible from the RequestContext
,
but will be invoked automatically by the framework as needed. Developers
can replace the standard processor using the
trinidad-config.xml
file.
To configure file uploads, the default instance supports three context initialization parameters :
UploadedFile
Field Summary | |
---|---|
static java.lang.String |
MAX_DISK_SPACE_PARAM_NAME
Initialization parameter for the default UploadedFileProcessor that configures the maximum
amount of disk space that can be used in a single request to store
uploaded files. |
static java.lang.String |
MAX_MEMORY_PARAM_NAME
Initialization parameter for the default UploadedFileProcessor that configures the maximum
amount of memory that can be used in a single request to store
uploaded files. |
static java.lang.String |
TEMP_DIR_PARAM_NAME
Initialization parameter for the default UploadedFileProcessor that configures the
to the directory where temporary files should be stored while
uploading. |
Method Summary | |
---|---|
void |
init(java.lang.Object context)
Initialize the UploadedFileProcessor with access to the current web application context. |
UploadedFile |
processFile(java.lang.Object request,
UploadedFile file)
Process a single uploaded file, moving it from temporary storage to per-request storage. |
Field Detail |
---|
static final java.lang.String MAX_MEMORY_PARAM_NAME
UploadedFileProcessor
that configures the maximum
amount of memory that can be used in a single request to store
uploaded files. Any requirements above this will be stored on disk.
The default is 100 kilobytes.
static final java.lang.String MAX_DISK_SPACE_PARAM_NAME
UploadedFileProcessor
that configures the maximum
amount of disk space that can be used in a single request to store
uploaded files. The default is 2000 kilobytes. Any requests that
exceed this size will result in an EOFException being thrown
on that request.
static final java.lang.String TEMP_DIR_PARAM_NAME
UploadedFileProcessor
that configures the
to the directory where temporary files should be stored while
uploading. This defaults to the the application server's temporary
directory, as provided by the "javax.servlet.context.tempdir"
property. If that is not set, the System "java.io.tempdir" property
will be used as a backup.
Method Detail |
---|
void init(java.lang.Object context)
context
- the current ServletContext or PortletContextUploadedFile processFile(java.lang.Object request, UploadedFile file) throws java.io.IOException
UploadedFile
object
and return a new UploadedFile
instance that will
remain valid for the duration of this request. The incoming
UploadedFile
object is a temporary file object that has a number of
restrictions:
UploadedFile.getInputStream()
may only be called onceUploadedFile.getLength()
returns -1, since the length is not yet availableUploadedFile.getFilename()
has not yet been internationalized; users should not
rely on its value, but simply use it unmodified in the
outgoing UploadedFile
The UploadedFile
object returned from this method
must remain valid for the duration of this request. The framework
guarantees that UploadedFile.dispose()
will be called before
the request completes.
request
- the current servlet or portlet requestfile
- a temporary file object
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |