|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultipartUploadSPI
This interface allows pluggable selection of the library to be used to parse the HttpServletRequest. Implementations are discovered through the usual JDK 1.3+ services mechanism (SPI).
Discovered instances are queried as to whether they are operative.
Instances that are operative are filtered based on their support for disk
caching and file upload size limits, if those were specified to matter. If
more than one instance remains after filtering for these criteria, an
implementation from outside the nextapp
package hierarchy is
selected randomly. If all implementations are from the nextapp
package hierarchy, then one is selected randomly.
Method Summary | |
---|---|
MultipartUploadSPI |
copy()
Returns a new instance of the implementation configured identically to the current instance. |
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 interface nextapp.echoservlet.EchoServer.MultipartRequestWrapper |
---|
getWrappedRequest |
Method Detail |
---|
boolean operative()
wrapRequest()
and updateComponent()
. This
allows an implementation to determine whether its supporting libraries
are available.
request
- request to be parsed
boolean supportsDiskCaching()
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()
.
boolean supportsFileUploadSizeLimit()
true
if they support limiting the
size of the upload. Implementations that return true
must
not throw an UnsupportedOperationException
for the method
setFileUploadSizeLimit()
.
void updateComponent(Connection conn, UploadSelect uploadSelect) throws java.io.IOException, javax.servlet.ServletException
fileUpload()
method of the
UploadSelect component.
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 operationvoid setMemoryCacheThreshold(int bytes) throws java.lang.UnsupportedOperationException
UnsupportedOperationException
.
bytes
- maximum size of the file upload before it will be cached
to disk
java.lang.UnsupportedOperationException
- if this implementation does not
support disk cachingvoid setDiskCacheLocation(java.io.File directory) throws java.io.IOException, java.lang.UnsupportedOperationException
directory
- location to store uploaded files
java.io.IOException
- if the directory does not exist or the File throws
an IOException during this operation
java.lang.UnsupportedOperationException
- if this implementation does not
support disk cachingvoid setFileUploadSizeLimit(int bytes) throws java.lang.UnsupportedOperationException
bytes
- the size threshold after which a file upload is rejected
java.lang.UnsupportedOperationException
- if this implementation does not
support limiting file upload sizesMultipartUploadSPI copy()
this
, but rather a newly instantiated object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |