Package com.jalios.jcms.upload
Class MultipartRequest
- java.lang.Object
- 
- javax.servlet.ServletRequestWrapper
- 
- javax.servlet.http.HttpServletRequestWrapper
- 
- com.jalios.jcms.upload.MultipartRequest
 
 
 
- 
- All Implemented Interfaces:
- javax.servlet.http.HttpServletRequest,- javax.servlet.ServletRequest,- org.apache.commons.fileupload.ProgressListener
 
 public class MultipartRequest extends javax.servlet.http.HttpServletRequestWrapper implements org.apache.commons.fileupload.ProgressListenerHttpServletRequest Wrapper decoding multipart request and displaying MULTIPART_UPLOAD instead in file fields. The method getFileUploadStatus() may be called by AJAX request to follow upload status- Since:
- jcms-5.7.0
- Author:
- Jean-Philippe Encausse
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringMULTIPART_UPLOAD
 - 
Constructor SummaryConstructors Constructor Description MultipartRequest(javax.servlet.http.HttpServletRequest request, java.io.File directory, int sizeThreshold, long sizeMax, boolean cacheMultipart)Deprecated.since 10.0.7 / JCMS-9840 as this constructor does not set the countMax limitMultipartRequest(javax.servlet.http.HttpServletRequest request, java.io.File directory, int sizeThreshold, long sizeMax, long countMax, boolean cacheMultipart)Wrap request for multipart handling.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.ServletInputStreamgetInputStream()javax.servlet.http.HttpServletRequestgetMultipartServletRequest()java.lang.StringgetParameter(java.lang.String name)java.util.Map<java.lang.String,java.lang.String[]>getParameterMap()java.util.Enumeration<java.lang.String>getParameterNames()java.lang.String[]getParameterValues(java.lang.String name)voidsetParameter(java.lang.String key, java.lang.String value)voidsetParameter(java.lang.String key, java.lang.String[] values)voidupdate(long pBytesRead, long pContentLength, int pItems)- 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapperauthenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
 - 
Methods inherited from class javax.servlet.ServletRequestWrappergetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface javax.servlet.ServletRequestgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
 
- 
 
- 
- 
- 
Field Detail- 
MULTIPART_UPLOADpublic static final java.lang.String MULTIPART_UPLOAD - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
MultipartRequest@Deprecated public MultipartRequest(javax.servlet.http.HttpServletRequest request, java.io.File directory, int sizeThreshold, long sizeMax, boolean cacheMultipart) throws java.io.UnsupportedEncodingException, org.apache.commons.fileupload.FileUploadExceptionDeprecated.since 10.0.7 / JCMS-9840 as this constructor does not set the countMax limit- Throws:
- java.io.UnsupportedEncodingException
- org.apache.commons.fileupload.FileUploadException
 
 - 
MultipartRequestpublic MultipartRequest(javax.servlet.http.HttpServletRequest request, java.io.File directory, int sizeThreshold, long sizeMax, long countMax, boolean cacheMultipart) throws java.io.UnsupportedEncodingException, org.apache.commons.fileupload.FileUploadExceptionWrap request for multipart handling.- Parameters:
- request- the HttpServletRequest to be handled as MultipartRequest
- directory- The data repository, which is the directory in which files will be created, should the item size exceed the threshold.
- sizeThreshold- The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
- sizeMax- The maximum allowed size of a single uploaded file.
- countMax- The maximum number of files allowed in a single request.
- cacheMultipart- true to use a- CachedServletRequest/- CachedServletInputStream, false to directly use specified request
- Throws:
- java.io.UnsupportedEncodingException
- org.apache.commons.fileupload.FileUploadException
- Since:
- 10.0.7 / JCMS-9840
 
 
- 
 - 
Method Detail- 
updatepublic void update(long pBytesRead, long pContentLength, int pItems)- Specified by:
- updatein interface- org.apache.commons.fileupload.ProgressListener
 
 - 
getMultipartServletRequestpublic javax.servlet.http.HttpServletRequest getMultipartServletRequest() 
 - 
setParameterpublic void setParameter(java.lang.String key, java.lang.String value)
 - 
setParameterpublic void setParameter(java.lang.String key, java.lang.String[] values)
 - 
getInputStreampublic javax.servlet.ServletInputStream getInputStream() throws java.io.IOException- Specified by:
- getInputStreamin interface- javax.servlet.ServletRequest
- Overrides:
- getInputStreamin class- javax.servlet.ServletRequestWrapper
- Throws:
- java.io.IOException
- See Also:
- ServletRequest.getInputStream()
 
 - 
getParameterpublic java.lang.String getParameter(java.lang.String name) - Specified by:
- getParameterin interface- javax.servlet.ServletRequest
- Overrides:
- getParameterin class- javax.servlet.ServletRequestWrapper
- See Also:
- ServletRequest.getParameter(String)
 
 - 
getParameterMappublic java.util.Map<java.lang.String,java.lang.String[]> getParameterMap() - Specified by:
- getParameterMapin interface- javax.servlet.ServletRequest
- Overrides:
- getParameterMapin class- javax.servlet.ServletRequestWrapper
- See Also:
- ServletRequest.getParameterMap()
 
 - 
getParameterNamespublic java.util.Enumeration<java.lang.String> getParameterNames() - Specified by:
- getParameterNamesin interface- javax.servlet.ServletRequest
- Overrides:
- getParameterNamesin class- javax.servlet.ServletRequestWrapper
- See Also:
- ServletRequest.getParameterNames()
 
 - 
getParameterValuespublic java.lang.String[] getParameterValues(java.lang.String name) - Specified by:
- getParameterValuesin interface- javax.servlet.ServletRequest
- Overrides:
- getParameterValuesin class- javax.servlet.ServletRequestWrapper
- See Also:
- ServletRequest.getParameterValues(String)
 
 
- 
 
-