|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.eftl.jakarta.commons.fileupload.JakartaCommonsFileUploadProvider
public class JakartaCommonsFileUploadProvider
Implementation of MultipartUploadSPI that uses the Jakarta Commons FileUpload library to perform the parsing of multipart HttpServletRequests.
Constructor Summary | |
---|---|
JakartaCommonsFileUploadProvider()
|
Method Summary | |
---|---|
MultipartUploadSPI |
copy()
Returns a new instance of the implementation configured identically to the current instance. |
javax.servlet.http.HttpServletRequest |
getWrappedRequest(javax.servlet.http.HttpServletRequest request)
Returns a replacement HttpServletRequest object that
may be used to handle a multipart/form-data encoded HTTP request. |
boolean |
operative()
Implementations return whether they are able to handle calls to wrapRequest() and updateComponent() . |
void |
setDiskCacheLocation(java.io.File directory)
Sets the directory to be used for storing file uploads that exceed the memory cache threshold. |
void |
setFileUploadSizeLimit(int bytes)
Sets the maximum size, in bytes, of file uploads to be accepted. |
void |
setMemoryCacheThreshold(int bytes)
Sets the size, in bytes, that the file upload must exceed before being cached to disk. |
boolean |
supportsDiskCaching()
Implementations return true if they support caching the
uploaded file to disk. |
boolean |
supportsFileUploadSizeLimit()
Implementations return true if they support limiting the
size of the upload. |
void |
updateComponent(Connection conn,
UploadSelect uploadSelect)
Implementations use the information from the HttpServletRequest in the Connection to call the fileUpload() method of the
UploadSelect component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JakartaCommonsFileUploadProvider()
Method Detail |
---|
public boolean operative()
MultipartUploadSPI
wrapRequest()
and updateComponent()
. This
allows an implementation to determine whether its supporting libraries
are available.
operative
in interface MultipartUploadSPI
MultipartUploadSPI.operative()
public boolean supportsDiskCaching()
MultipartUploadSPI
true
if they support caching the
uploaded file to disk. Implementations that return true
must not throw UnsupportedOperationException
s for the
methods setMemoryCacheThreshold()
and
setDiskCacheLocation()
.
supportsDiskCaching
in interface MultipartUploadSPI
MultipartUploadSPI.supportsDiskCaching()
public boolean supportsFileUploadSizeLimit()
MultipartUploadSPI
true
if they support limiting the
size of the upload. Implementations that return true
must
not throw an UnsupportedOperationException
for the method
setFileUploadSizeLimit()
.
supportsFileUploadSizeLimit
in interface MultipartUploadSPI
MultipartUploadSPI.supportsFileUploadSizeLimit()
public void updateComponent(Connection conn, UploadSelect uploadSelect) throws java.io.IOException, javax.servlet.ServletException
MultipartUploadSPI
fileUpload()
method of the
UploadSelect component.
updateComponent
in interface MultipartUploadSPI
conn
- provides access to the HttpServletRequestuploadSelect
- component to be updated with the file upload
information
java.io.IOException
- if the Connection or the HttpServletRequest throws
an IOException during the operation
javax.servlet.ServletException
- if Connection or the HttpServletRequest throws
an IOException during the operationMultipartUploadSPI.updateComponent(nextapp.echoservlet.Connection, nextapp.echo.filetransfer.UploadSelect)
public void setMemoryCacheThreshold(int bytes) throws java.lang.UnsupportedOperationException
MultipartUploadSPI
UnsupportedOperationException
.
setMemoryCacheThreshold
in interface MultipartUploadSPI
bytes
- maximum size of the file upload before it will be cached
to disk
java.lang.UnsupportedOperationException
- if this implementation does not
support disk cachingMultipartUploadSPI.setMemoryCacheThreshold(int)
public void setDiskCacheLocation(java.io.File directory) throws java.io.IOException
MultipartUploadSPI
setDiskCacheLocation
in interface MultipartUploadSPI
directory
- location to store uploaded files
java.io.IOException
- if the directory does not exist or the File throws
an IOException during this operationMultipartUploadSPI.setDiskCacheLocation(java.io.File)
public void setFileUploadSizeLimit(int bytes) throws java.lang.UnsupportedOperationException
MultipartUploadSPI
setFileUploadSizeLimit
in interface MultipartUploadSPI
bytes
- the size threshold after which a file upload is rejected
java.lang.UnsupportedOperationException
- if this implementation does not
support limiting file upload sizesMultipartUploadSPI.setFileUploadSizeLimit(int)
public MultipartUploadSPI copy()
MultipartUploadSPI
this
, but rather a newly instantiated object.
copy
in interface MultipartUploadSPI
MultipartUploadSPI.copy()
public javax.servlet.http.HttpServletRequest getWrappedRequest(javax.servlet.http.HttpServletRequest request) throws java.io.IOException, javax.servlet.ServletException
EchoServer.MultipartRequestWrapper
HttpServletRequest
object that
may be used to handle a multipart/form-data encoded HTTP request.
getWrappedRequest
in interface EchoServer.MultipartRequestWrapper
request
- The HTTP request provided from the servlet container that
has multipart/form-data encoding.
java.io.IOException
javax.servlet.ServletException
EchoServer.MultipartRequestWrapper.getWrappedRequest(javax.servlet.http.HttpServletRequest)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |