|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.request.Request org.apache.wicket.request.http.WebRequest org.apache.wicket.protocol.http.servlet.ServletWebRequest org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest org.apache.wicket.protocol.http.servlet.MultipartServletWebRequestImpl
public class MultipartServletWebRequestImpl
Servlet specific WebRequest subclass for multipart content uploads.
Field Summary |
---|
Fields inherited from class org.apache.wicket.request.http.WebRequest |
---|
HEADER_AJAX, HEADER_AJAX_BASE_URL, PARAM_AJAX, PARAM_AJAX_BASE_URL, PARAM_AJAX_REQUEST_ANTI_CACHE |
Constructor Summary | |
---|---|
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,
FileItemFactory factory)
Constructor |
Method Summary | |
---|---|
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<FileItem> |
getFile(String fieldName)
Gets the file that was uploaded using the given field name. |
Map<String,List<FileItem>> |
getFiles()
|
static UploadInfo |
getUploadInfo(javax.servlet.http.HttpServletRequest req,
String upload)
Retrieves UploadInfo from session, null if not found. |
MultipartServletWebRequest |
newMultipartWebRequest(Bytes maxSize,
String upload)
Creates multipart web request from this request. |
MultipartServletWebRequest |
newMultipartWebRequest(Bytes maxSize,
String upload,
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 |
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. |
Methods inherited from class org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest |
---|
cloneWithUrl |
Methods inherited from class org.apache.wicket.protocol.http.servlet.ServletWebRequest |
---|
getCharset, getClientUrl, getContainerRequest, getContextPath, getCookies, getDateHeader, getFilterPath, getFilterPrefix, getHeader, getHeaders, getLocale, getPostParameters, getPrefixToContextPath, getUrl, shouldPreserveClientUrl |
Methods inherited from class org.apache.wicket.request.http.WebRequest |
---|
getCookie, getIfModifiedSinceHeader, isAjax |
Methods inherited from class org.apache.wicket.request.Request |
---|
getOriginalUrl, getQueryParameters, getRequestParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request, String filterPrefix, Bytes maxSize, String upload) throws 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
FileUploadException
- Thrown if something goes wrong with uploadpublic MultipartServletWebRequestImpl(javax.servlet.http.HttpServletRequest request, String filterPrefix, Bytes maxSize, String upload, FileItemFactory factory) throws 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 files
FileUploadException
- Thrown if something goes wrong with uploadMethod Detail |
---|
public Map<String,List<FileItem>> getFiles()
public List<FileItem> getFile(String fieldName)
fieldName
- the field name that was used for the upload
protected Map<String,List<StringValue>> generatePostParameters()
generatePostParameters
in class ServletWebRequest
protected boolean wantUploadProgressUpdates()
IApplicationSettings.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 FileUploadException
ServletWebRequest
newMultipartWebRequest
in class ServletWebRequest
upload
- upload identifier for UploadInfo
FileUploadException
public MultipartServletWebRequest newMultipartWebRequest(Bytes maxSize, String upload, FileItemFactory factory) throws FileUploadException
ServletWebRequest
newMultipartWebRequest
in class ServletWebRequest
upload
- upload identifier for UploadInfo
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 identifier
UploadInfo
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 identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |