|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tapestry.multipart.DefaultMultipartDecoder
Decodes the data in a multipart/form-data
HTTP request, handling file uploads and
multi-valued parameters. After decoding, the class is used to access the parameter values.
This implementation is a thin wrapper around the Apache Jakarta FileUpload .
Supports single valued parameters, multi-valued parameters and individual file uploads. That is,
for file uploads, each upload must be a unique parameter (that is all the
Upload
component needs).
Field Summary | |
static java.lang.String |
PART_MAP_ATTRIBUTE_NAME
Request attribute key used to store the part map for this request. |
static java.lang.String |
STRING_NAMES_ATTRIBUTE_NAME
|
Constructor Summary | |
DefaultMultipartDecoder()
|
Method Summary | |
void |
cleanup(javax.servlet.http.HttpServletRequest request)
Invokes IPart.cleanup() on each part. |
void |
decode(javax.servlet.http.HttpServletRequest request)
Decodes the request, storing the part map (keyed on query parameter name, value is IPart into the request as an attribute. |
int |
getMaxSize()
|
java.lang.String |
getRepositoryPath()
|
static DefaultMultipartDecoder |
getSharedInstance()
|
java.lang.String |
getString(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Returns the single value (or first value) for the parameter with the specified name. |
java.lang.String[] |
getStringParameterNames(javax.servlet.http.HttpServletRequest request)
Returns the names of all parameters whose type is string (not file upload). |
java.lang.String[] |
getStrings(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Returns an array of values (possibly a single element array). |
int |
getThresholdSize()
|
IUploadFile |
getUploadFile(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
Returns the uploaded file with the specified parameter name, or null if no such parameter was in the request. |
static boolean |
isMultipartRequest(javax.servlet.http.HttpServletRequest request)
|
void |
setMaxSize(int maxSize)
|
void |
setRepositoryPath(java.lang.String repositoryPath)
|
void |
setThresholdSize(int thresholdSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PART_MAP_ATTRIBUTE_NAME
decode(HttpServletRequest)
. By storing the part map in the request instead of an
instance variable, DefaultMultipartDecoder becomes threadsafe (no client-specific state in
instance variables).
public static final java.lang.String STRING_NAMES_ATTRIBUTE_NAME
Constructor Detail |
public DefaultMultipartDecoder()
Method Detail |
public static DefaultMultipartDecoder getSharedInstance()
public void setMaxSize(int maxSize)
public int getMaxSize()
public void setThresholdSize(int thresholdSize)
public int getThresholdSize()
public void setRepositoryPath(java.lang.String repositoryPath)
public java.lang.String getRepositoryPath()
public static boolean isMultipartRequest(javax.servlet.http.HttpServletRequest request)
public void cleanup(javax.servlet.http.HttpServletRequest request)
IPart.cleanup()
on each part.
cleanup
in interface IMultipartDecoder
public void decode(javax.servlet.http.HttpServletRequest request)
IPart
into the request as an attribute.
decode
in interface IMultipartDecoder
org.apache.hivemind.ApplicationRuntimeException
- if decode fails, for instance the request exceeds getMaxSize()public java.lang.String getString(javax.servlet.http.HttpServletRequest request, java.lang.String name)
IMultipartDecoder
getString
in interface IMultipartDecoder
public java.lang.String[] getStrings(javax.servlet.http.HttpServletRequest request, java.lang.String name)
IMultipartDecoder
getStrings
in interface IMultipartDecoder
public java.lang.String[] getStringParameterNames(javax.servlet.http.HttpServletRequest request)
IMultipartDecoder
getStringParameterNames
in interface IMultipartDecoder
public IUploadFile getUploadFile(javax.servlet.http.HttpServletRequest request, java.lang.String name)
IMultipartDecoder
getUploadFile
in interface IMultipartDecoder
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |