|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.servlet.JcmsServletFilter
com.jalios.jcms.upload.MultipartFilter
public class MultipartFilter
Filter for automatic file upload processing. it wrapper HttpServletRequest to pass any form parameters in usuall form (normally they are not accessible cause JSDK web container are not required to implement RFC1867).
Use filter attribute "uploadDir" to set temporary directory. If there is no attribute, then create a sub directory upload.tmp in javax.servlet.context.tempdir path.
Use filter attribute "sizeMax" to set max size otherwise use 2048000000L.
Use filter attribute "sizeThreshold" the threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.. Default value is 4096.
FileItem access is done through attributes. By default they are named after the form field name. However you are allowed to supply attributePrefix and/or attributeSuffix that will be used to "decorate" the attribute name. Request parameter is still set with a fake value defined by filter attribute "fakeParam".
Field Summary | |
---|---|
protected String |
attribPrefix
|
protected String |
attribSuffix
|
protected javax.servlet.FilterConfig |
config
|
protected File |
directory
|
protected String |
fakeParam
|
protected boolean |
initFilter
|
static String |
REVISION
|
protected long |
sizeMax
|
protected int |
sizeThreshold
|
Constructor Summary | |
---|---|
MultipartFilter()
|
Method Summary | |
---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
Wraps the ServletRequest into a MultiPart Request if it contains multipart data. |
void |
init(javax.servlet.FilterConfig cfg)
|
void |
initFileUpload()
Initialise filter's parameter from FilterConfing and JCMS Properties |
protected void |
registerJSONClass(javax.servlet.http.HttpServletRequest request)
Register MultipartRequest class in JSON for use by docChooser.js upload status |
protected javax.servlet.http.HttpServletRequest |
wrapRequest(javax.servlet.http.HttpServletRequest request)
Wrap the request into a MultipartRequest if we are in MultipartContent with upload |
Methods inherited from class com.jalios.jcms.servlet.JcmsServletFilter |
---|
initJSONBridge, processFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected javax.servlet.FilterConfig config
protected String attribPrefix
protected String attribSuffix
protected String fakeParam
protected File directory
protected int sizeThreshold
protected long sizeMax
protected boolean initFilter
Constructor Detail |
---|
public MultipartFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig cfg) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
Filter.init(FilterConfig)
public void initFileUpload() throws javax.servlet.ServletException
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
protected void registerJSONClass(javax.servlet.http.HttpServletRequest request)
request
- current HttpServletRequestprotected javax.servlet.http.HttpServletRequest wrapRequest(javax.servlet.http.HttpServletRequest request)
request
- current HttpServletRequest
public void destroy()
destroy
in interface javax.servlet.Filter
Filter.destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |