public class MultipartServletWebRequestImpl extends MultipartServletWebRequest
HEADER_AJAX, HEADER_AJAX_BASE_URL, HEADER_ORIGIN, HEADER_REFERER, PARAM_AJAX, PARAM_AJAX_BASE_URL, PARAM_AJAX_REQUEST_ANTI_CACHE
Constructor and Description |
---|
MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request,
String filterPrefix,
Bytes maxSize,
String upload)
Constructor.
|
MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request,
String filterPrefix,
Bytes maxSize,
String upload,
org.apache.commons.fileupload.FileItemFactory factory)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
clearUploadInfo(javax.servlet.http.HttpServletRequest req,
String upload)
Clears the
UploadInfo object from session if one exists. |
protected Map<String,List<StringValue>> |
generatePostParameters() |
List<org.apache.commons.fileupload.FileItem> |
getFile(String fieldName)
Gets the file that was uploaded using the given field name.
|
Map<String,List<org.apache.commons.fileupload.FileItem>> |
getFiles() |
static UploadInfo |
getUploadInfo(javax.servlet.http.HttpServletRequest req,
String upload)
Retrieves
UploadInfo from session, null if not found. |
protected org.apache.commons.fileupload.FileUploadBase |
newFileUpload(String encoding)
Factory method for creating new instances of FileUploadBase
|
MultipartServletWebRequest |
newMultipartWebRequest(Bytes maxSize,
String upload)
Creates multipart web request from this request.
|
MultipartServletWebRequest |
newMultipartWebRequest(Bytes maxSize,
String upload,
org.apache.commons.fileupload.FileItemFactory factory)
Creates multipart web request from this request.
|
protected void |
onUploadCompleted()
Upload completed callback
|
protected void |
onUploadStarted(int totalBytes)
Upload start callback
|
protected void |
onUploadUpdate(int bytesUploaded,
int total)
Upload status update callback
|
void |
parseFileParts()
Parses the multipart body of the request.
|
static void |
setUploadInfo(javax.servlet.http.HttpServletRequest req,
String upload,
UploadInfo uploadInfo)
Sets the
UploadInfo object into session. |
protected boolean |
wantUploadProgressUpdates()
Subclasses that want to receive upload notifications should return true.
|
cloneWithUrl, getFileMaxSize, getMaxSize, setFileMaxSize, setMaxSize
getCharset, getClientUrl, getContainerRequest, getContextPath, getCookies, getDateHeader, getFilterPath, getFilterPrefix, getHeader, getHeaders, getLocale, getPostParameters, getPrefixToContextPath, getUrl, shouldPreserveClientUrl
getCookie, getIfModifiedSinceHeader, isAjax
getOriginalUrl, getQueryParameters, getRequestParameters
public MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request, String filterPrefix, Bytes maxSize, String upload) throws org.apache.commons.fileupload.FileUploadException
DiskFileItemFactory
to store uploads.request
- the servlet requestfilterPrefix
- prefix to wicket filter mappingmaxSize
- the maximum size allowed for this requestupload
- upload identifier for UploadInfo
org.apache.commons.fileupload.FileUploadException
- Thrown if something goes wrong with uploadpublic MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request, String filterPrefix, Bytes maxSize, String upload, org.apache.commons.fileupload.FileItemFactory factory) throws org.apache.commons.fileupload.FileUploadException
request
- the servlet requestfilterPrefix
- prefix to wicket filter mappingmaxSize
- the maximum size allowed for this requestupload
- upload identifier for UploadInfo
factory
- DiskFileItemFactory
to use when creating file items used to represent
uploaded filesorg.apache.commons.fileupload.FileUploadException
- Thrown if something goes wrong with uploadpublic void parseFileParts() throws org.apache.commons.fileupload.FileUploadException
MultipartServletWebRequest
parseFileParts
in class MultipartServletWebRequest
org.apache.commons.fileupload.FileUploadException
protected org.apache.commons.fileupload.FileUploadBase newFileUpload(String encoding)
encoding
- The encoding to use while reading the datapublic Map<String,List<org.apache.commons.fileupload.FileItem>> getFiles()
public List<org.apache.commons.fileupload.FileItem> getFile(String fieldName)
fieldName
- the field name that was used for the uploadprotected Map<String,List<StringValue>> generatePostParameters()
generatePostParameters
in class ServletWebRequest
protected boolean wantUploadProgressUpdates()
ApplicationSettings.isUploadProgressUpdatesEnabled()
.protected void onUploadStarted(int totalBytes)
totalBytes
- protected void onUploadUpdate(int bytesUploaded, int total)
bytesUploaded
- total
- protected void onUploadCompleted()
public MultipartServletWebRequest newMultipartWebRequest(Bytes maxSize, String upload) throws org.apache.commons.fileupload.FileUploadException
ServletWebRequest
newMultipartWebRequest
in class ServletWebRequest
maxSize
- max allowed size of requestupload
- upload identifier for UploadInfo
org.apache.commons.fileupload.FileUploadException
public MultipartServletWebRequest newMultipartWebRequest(Bytes maxSize, String upload, org.apache.commons.fileupload.FileItemFactory factory) throws org.apache.commons.fileupload.FileUploadException
ServletWebRequest
newMultipartWebRequest
in class ServletWebRequest
maxSize
- max allowed size of requestupload
- upload identifier for UploadInfo
org.apache.commons.fileupload.FileUploadException
public static UploadInfo getUploadInfo(javax.servlet.http.HttpServletRequest req, String upload)
UploadInfo
from session, null if not found.req
- http servlet request, not nullupload
- upload identifierUploadInfo
object from session, or null if not foundpublic static void setUploadInfo(javax.servlet.http.HttpServletRequest req, String upload, UploadInfo uploadInfo)
UploadInfo
object into session.req
- http servlet request, not nullupload
- upload identifieruploadInfo
- UploadInfo
object to be put into session, not nullpublic static void clearUploadInfo(javax.servlet.http.HttpServletRequest req, String upload)
UploadInfo
object from session if one exists.req
- http servlet request, not nullupload
- upload identifierCopyright © 2006–2022 Apache Software Foundation. All rights reserved.