|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler
public class MultipartFormHandler
MultipartFormHandler - parses an incoming file upload post. This classs parses the incoming post and returns MultipartStreamItems for each form item.
If setCharacterEncoding() is called (with anything other than null),
then strings returned from this class will be character-set decoded.
Otherwise, strings returned from this class are not character-set
decoded. In this way, MultipartFormHandler precisely matches
the behavior of ServletRequest. Clients should use
CaboHttpUtils.decodeRequestParameter()
to decode
any returned parameters.
Constructor Summary | |
---|---|
MultipartFormHandler(javax.faces.context.ExternalContext externalContext)
Create a MultipartFormHandler for the given servlet request. |
|
MultipartFormHandler(java.lang.String type,
java.io.InputStream in)
Create a MultipartFormHandler for the given InputStream and content type. |
Method Summary | |
---|---|
long |
getBytesRead()
Returns the total number of bytes yet read. |
java.lang.String |
getCharacterEncoding()
Gets the character enocoding. |
long |
getMaximumAllowedBytes()
Gets the maximum number of bytes that MultipartFormItem.writeFile() will be allowed to write. |
MultipartFormItem |
getNextPart()
Returns the next MultipartStreamItem from the request, or null if no more are present. |
long |
getTotalBytes()
Returns the total size of the incoming content, or -1 if the length is not known. |
static boolean |
isMultipartRequest(javax.faces.context.ExternalContext externalContext)
Returns true if the servlet request is a multipart request. |
void |
setCharacterEncoding(java.lang.String characterEncoding)
Sets the character encoding. |
void |
setMaximumAllowedBytes(long maxAllowedBytes)
Sets the maximum number of bytes that MultipartFormItem.writeFile() will be allowed to write. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultipartFormHandler(javax.faces.context.ExternalContext externalContext) throws java.io.IOException
java.io.IOException
public MultipartFormHandler(java.lang.String type, java.io.InputStream in) throws java.io.IOException
type
- The content type, including the boundary string.
The content type must be "multipart/form-data", and
must define the multipart boundary value.in
- The InputStream which provides the multipart/form-data content
java.io.IOException
Method Detail |
---|
public static boolean isMultipartRequest(javax.faces.context.ExternalContext externalContext)
public java.lang.String getCharacterEncoding()
public void setCharacterEncoding(java.lang.String characterEncoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public long getBytesRead()
public long getTotalBytes()
public void setMaximumAllowedBytes(long maxAllowedBytes)
maxAllowedBytes
- the maximum number of bytes that
MultipartFormItem.writeFile() will be allowed to write. Defaults
to 128MB.MultipartFormItem.writeFile(java.io.OutputStream)
public long getMaximumAllowedBytes()
public MultipartFormItem getNextPart() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |