oracle.cabo.data.jbo.servlet.io
Class OrdFileUploadManager
java.lang.Object
|
+--oracle.cabo.servlet.io.FileUploadManager
|
+--oracle.cabo.servlet.io.BaseFileUploadManager
|
+--oracle.cabo.data.jbo.servlet.io.OrdFileUploadManager
- public class OrdFileUploadManager
- extends BaseFileUploadManager
OrdFileUploadManager 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.
OrdFileUploadManager is an interMedia custom implementation of
FileUploadManager
. It 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.
Two servlet init parameters for oracle.cabo.servlet.BajaServlet
are
used to manage the memory useage:
<init-param>
<param-name>oracle.cabo.data.jbo.servlet.ord.HttpMaxMemory</param-name>
<param-value>102400</param-value>
</init-param>
<init-param>
<param-name>oracle.cabo.data.jbo.servlet.ord.HttpTempDir</param-name>
<param-value>D:/temp/ord</param-value>
</init-param>
If they are not specified, the default value for
oracle.cabo.data.jbo.servlet.ord.HttpMaxMemory
is
102400 bytes; the default value for
oracle.cabo.data.jbo.servlet.ord.HttpTempDir
is
java.io.tmpdir
system property value.
The parsed items are stored in a Map
object with HTML form file field
names
as keys, and oracle.ord.im.OrdHttpUploadFile
instances as values. The
Map
object is wrapped in a OrdFileUploadForm
instance that
is registered in BajaContext
.
When the current Http request ends, the resources used by
OrdHttpUploadFile
will be released.
Method Summary |
void |
destroy()
Provides an opportunity to cleanup the OrdFileUploadManager. |
protected java.lang.String |
doUploadFile(BajaContext context,
Page page,
MultipartFormItem item)
Handler for uploading a file. |
void |
init(javax.servlet.ServletConfig config)
Initializes the OrdFileUploadManager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OrdFileUploadManager
public OrdFileUploadManager()
init
public void init(javax.servlet.ServletConfig config)
- Initializes the OrdFileUploadManager. Initializes
ord.HttpMaxMemory
and ord.HttpTempDir
properties.
- Overrides:
init
in class FileUploadManager
- Parameters:
servlet
- the servlet instanceconfig
- the servlet configuration
destroy
public void destroy()
- Provides an opportunity to cleanup the OrdFileUploadManager.
- Overrides:
destroy
in class FileUploadManager
doUploadFile
protected java.lang.String doUploadFile(BajaContext context,
Page page,
MultipartFormItem item)
throws java.io.IOException
- Description copied from class:
BaseFileUploadManager
- Handler for uploading a file. Clients should
override this method to process the MultipartFormItem. The
return value of this function will be added to the PageEvent;
if clients need further processing of the item in subsequent
handling of the page, they should return a meaningful string
after reading the file.
- Overrides:
doUploadFile
in class BaseFileUploadManager
- Following copied from class:
oracle.cabo.servlet.io.BaseFileUploadManager
- Parameters:
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- Returns:
- a value that will be inserted into the PageEvent
as a substitute for the actual file contents.