|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UploadService
This service handles parsing multipart/form-data
POST requests and turning them into form fields and uploaded files.
This can be either performed automatically by the org.apache.fulcrum.parser.ParameterParser
or manually by an user
defined org.apache.turbine.modules.Action
.
Field Summary | |
---|---|
static String |
CONTENT_DISPOSITION
HTTP header. |
static String |
CONTENT_TYPE
HTTP header. |
static String |
FORM_DATA
HTTP header base type modifier. |
static String |
HEADER_ENCODING_DEFAULT
The default value of 'headerEncoding' property (.). |
static String |
HEADER_ENCODING_KEY
The key in UploadService properties in TurbineResources.properties 'headerEncoding' property. |
static String |
MIXED
HTTP header base type modifier. |
static String |
MULTIPART
HTTP header base type. |
static String |
MULTIPART_FORM_DATA
HTTP header. |
static String |
MULTIPART_MIXED
HTTP header. |
static String |
REPOSITORY_DEFAULT
The default value of 'repository' property (.). |
static String |
REPOSITORY_KEY
The key in UploadService properties in TurbineResources.properties 'repository' property. |
static String |
REPOSITORY_PARAMETER
The request parameter name for overriding 'repository' property (path). |
static String |
ROLE
Avalon Identifier |
static int |
SIZE_MAX_DEFAULT
The default value of 'sizMax' property (1 megabyte = 1048576 bytes). |
static String |
SIZE_MAX_KEY
w The key in UploadService properties in service configuration 'sizeMax' property. |
static int |
SIZE_THRESHOLD_DEFAULT
The default value of 'sizeThreshold' property (10 kilobytes = 10240 bytes). |
static String |
SIZE_THRESHOLD_KEY
The key in UploadService properties in TurbineResources.properties 'sizeThreshold' property. |
Method Summary | |
---|---|
String |
getHeaderEncoding()
Retrieves the value of the headerEncoding property of
UploadService . |
org.apache.commons.fileupload.FileItemIterator |
getItemIterator(javax.servlet.http.HttpServletRequest req)
Processes an RFC 1867 compliant multipart/form-data stream. |
String |
getRepository()
Retrieves the value of the repository property of
UploadService . |
long |
getSizeMax()
Retrieves the value of size.max property of the
UploadService . |
long |
getSizeThreshold()
Retrieves the value of size.threshold property of
UploadService . |
boolean |
isMultipart(javax.servlet.http.HttpServletRequest req)
Utility method that determines whether the request contains multipart content. |
List<org.apache.commons.fileupload.FileItem> |
parseRequest(javax.servlet.http.HttpServletRequest req)
Parses a RFC 1867 compliant multipart/form-data stream. |
List<org.apache.commons.fileupload.FileItem> |
parseRequest(javax.servlet.http.HttpServletRequest req,
int sizeThreshold,
int sizeMax,
String path)
Parses a RFC 1867 compliant multipart/form-data stream. |
List<org.apache.commons.fileupload.FileItem> |
parseRequest(javax.servlet.http.HttpServletRequest req,
String path)
Parses a RFC 1867 compliant multipart/form-data stream. |
Field Detail |
---|
static final String ROLE
static final String CONTENT_TYPE
static final String CONTENT_DISPOSITION
static final String MULTIPART
static final String FORM_DATA
static final String MIXED
static final String MULTIPART_FORM_DATA
static final String MULTIPART_MIXED
static final String REPOSITORY_PARAMETER
static final String REPOSITORY_KEY
static final String REPOSITORY_DEFAULT
The default value of 'repository' property (.). This is the directory where uploaded files will get stored temporarily. Note that "." is whatever the servlet container chooses to be it's 'current directory'.
static final String SIZE_MAX_KEY
static final int SIZE_MAX_DEFAULT
The default value of 'sizMax' property (1 megabyte = 1048576 bytes). This is the maximum size of POST request that will be parsed by the uploader. If you need to set specific limits for your users, set this property to the largest limit value, and use an action + no auto upload to enforce limits.
static final String SIZE_THRESHOLD_KEY
static final int SIZE_THRESHOLD_DEFAULT
The default value of 'sizeThreshold' property (10 kilobytes = 10240 bytes). This is the maximum size of a POST request that will have it's components stored temporarily in memory, instead of disk.
static final String HEADER_ENCODING_KEY
static final String HEADER_ENCODING_DEFAULT
The default value of 'headerEncoding' property (.). The value has been decided by copying from DiskFileItem class
Method Detail |
---|
List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest req) throws org.apache.avalon.framework.service.ServiceException
Parses a RFC 1867
compliant multipart/form-data
stream.
req
- The servlet request to be parsed.
org.apache.avalon.framework.service.ServiceException
- Problems reading/parsing the
request or storing the uploaded file(s).List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest req, String path) throws org.apache.avalon.framework.service.ServiceException
Parses a RFC 1867
compliant multipart/form-data
stream.
req
- The servlet request to be parsed.path
- The location where the files should be stored.
org.apache.avalon.framework.service.ServiceException
- Problems reading/parsing the
request or storing the uploaded file(s).List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest req, int sizeThreshold, int sizeMax, String path) throws org.apache.avalon.framework.service.ServiceException
Parses a RFC 1867
compliant multipart/form-data
stream.
req
- The servlet request to be parsed.sizeThreshold
- the max size in bytes to be stored in memorysizeMax
- the maximum allowed upload size in bytespath
- The location where the files should be stored.
org.apache.avalon.framework.service.ServiceException
- Problems reading/parsing the
request or storing the uploaded file(s).org.apache.commons.fileupload.FileItemIterator getItemIterator(javax.servlet.http.HttpServletRequest req) throws org.apache.avalon.framework.service.ServiceException
multipart/form-data
stream.
req
- The servlet request to be parsed.
FileItemStream
parsed from the request, in the order that they were
transmitted.
org.apache.avalon.framework.service.ServiceException
- if there are problems reading/parsing
the request or storing files. This
may also be a network error while
communicating with the client or a
problem while storing the uploaded
content.long getSizeMax()
Retrieves the value of size.max
property of the
UploadService
.
long getSizeThreshold()
Retrieves the value of size.threshold
property of
UploadService
.
String getRepository()
Retrieves the value of the repository
property of
UploadService
.
String getHeaderEncoding()
Retrieves the value of the headerEncoding
property of
UploadService
.
boolean isMultipart(javax.servlet.http.HttpServletRequest req)
req
- The servlet request to be evaluated. Must be non-null.
true
if the request is multipart;
false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |