|
UIX 2.2.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.servlet.io.FileUploadManager | +--oracle.cabo.servlet.io.BaseFileUploadManager | +--oracle.cabo.servlet.io.DefaultFileUploadManager
DefaultFileUploadManager is initialized during UIX Servlet startup and destroyed on UIX Servlet shutdown. It is responsible for managing multipart form data upload requests, mapping them to a suitable PageEvent, for later use in an event handler.
DefaultFileUploadManager allows users to specify a maximum memory size limit for multipart file upload per one HTTP Post request. For the upload content that exceeds the limit, the content will be stored as a temporary file in a specified directory. Users can also specify a maximum size limit for files stored in the directory per request; if content exceeds that value, the request will be aborted.
Three servlet init parameters for
oracle.cabo.servlet.UIXServlet
are
used to manage the memory useage:
<init-param> <param-name>oracle.cabo.servlet.io.MaxMemory</param-name> <param-value>102400</param-value> </init-param> <init-param> <param-name>oracle.cabo.servlet.io.MaxDiskSpace</param-name> <param-value>1024000</param-value> </init-param> <init-param> <param-name>oracle.cabo.servlet.io.TempDirectory</param-name> <param-value>D:/temp/someDirectory</param-value> </init-param>If they are not specified, the default value for
oracle.cabo.servlet.io.MaxMemory
is
102,400 bytes, the default value for
oracle.cabo.servlet.io.MaxDiskSpace
is
2,048,000 bytes, and the default value for
oracle.cabo.servlet.io.TempDirectory
is the
server's temporary directory, as defined by Java's java.io.File
API.
The parsed items are stored as UploadedFile
objects
in an UploadedFileMap
,
with HTML form file field names as keys.
When the current Http request ends, the resources used by
DefaultFileUploadManager
will be released.
UploadedFile
,
UploadedFileMap
Constructor Summary | |
DefaultFileUploadManager()
Creates a DefaultFileUploadManager. |
Method Summary | |
protected java.lang.String |
doUploadFile(BajaContext context,
Page page,
MultipartFormItem item)
Uploads a single file. |
long |
getMaxDiskSpace()
Returns the maximum disk space that can be consumed while processing a single request. |
long |
getMaxMemory()
Returns the maximum memory that can be consumed while processing a single request. |
java.lang.String |
getTempDirectory()
Returns the directory that will be used to store temporary files. |
void |
init(javax.servlet.ServletConfig config)
Initializes the DefaultFileUploadManager. |
void |
setMaxDiskSpace(long maxDiskSpace)
Sets the maximum disk space that can be consumed while processing a single request. |
void |
setMaxMemory(long maxMemory)
Sets the maximum memory that can be consumed while processing a single request. |
void |
setTempDirectory(java.lang.String tempDir)
Sets the directory that will be used to store temporary files. |
Methods inherited from class oracle.cabo.servlet.io.BaseFileUploadManager |
decodeMultipartRequest, getMaximumAllowedBytes, setMaximumAllowedBytes |
Methods inherited from class oracle.cabo.servlet.io.FileUploadManager |
destroy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultFileUploadManager()
Method Detail |
public void init(javax.servlet.ServletConfig config)
init
in class FileUploadManager
config
- the servlet configurationpublic long getMaxDiskSpace()
public void setMaxDiskSpace(long maxDiskSpace)
public long getMaxMemory()
public void setMaxMemory(long maxMemory)
public java.lang.String getTempDirectory()
java.io.File.createTempFile()
.public void setTempDirectory(java.lang.String tempDir)
java.io.File.createTempFile()
.protected java.lang.String doUploadFile(BajaContext context, Page page, MultipartFormItem item) throws java.io.IOException
doUploadFile
in class BaseFileUploadManager
oracle.cabo.servlet.io.BaseFileUploadManager
context
- the BajaContext for this requestpage
- the page the file is being uploaded from;
this page object has not yet been validated for login
or any other handlingitem
- a MultipartFormItem that can be used to
retrieve the file
|
UIX 2.2.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |