public class UploadParser extends Object
This code replaces the apache fileupload code because that code does not properly return the fact that *no* file was uploaded (i.e. the input was empty), and because that implementation does not return an actual File without casting.
To use this, first ask if a HttpRequest is a valid upload request using the "isMultipartContent()" call. Then ask an instance of this class to parse the request. This returns a Map of items present in the request.
Created on Nov 21, 2005
| Constructor and Description |
|---|
UploadParser() |
| Modifier and Type | Method and Description |
|---|---|
int |
getSizeMax() |
static boolean |
isMultipartContent(javax.servlet.http.HttpServletRequest req)
Returns T if the request is encoded as multipart (i.e.
|
List<UploadItem> |
parseRequest(javax.servlet.http.HttpServletRequest ctx,
String hdrencoding) |
List<UploadItem> |
parseRequest(InputStream is,
String hdrencoding,
String contentType,
int requestSize) |
void |
setSizeMax(int sizeMax) |
static javax.servlet.http.HttpServletRequest |
wrapIfNeeded(javax.servlet.http.HttpServletRequest req) |
public final int getSizeMax()
public final void setSizeMax(int sizeMax)
public static final boolean isMultipartContent(javax.servlet.http.HttpServletRequest req)
req - public static final javax.servlet.http.HttpServletRequest wrapIfNeeded(javax.servlet.http.HttpServletRequest req)
public List<UploadItem> parseRequest(javax.servlet.http.HttpServletRequest ctx, String hdrencoding) throws FileUploadException, IOException
FileUploadExceptionIOExceptionpublic List<UploadItem> parseRequest(InputStream is, String hdrencoding, String contentType, int requestSize) throws FileUploadException, IOException
FileUploadExceptionIOExceptionCopyright © 2017 etc.to. All rights reserved.