info.magnolia.cms.filters
Class MultipartRequestFilter

java.lang.Object
  extended by info.magnolia.cms.filters.AbstractMgnlFilter
      extended by info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter
          extended by info.magnolia.cms.filters.MultipartRequestFilter
All Implemented Interfaces:
MgnlFilter, javax.servlet.Filter

public class MultipartRequestFilter
extends OncePerRequestAbstractMgnlFilter

A Filter that determines if a HttpServletRequest contains multipart content and if so parses it into a request attribute for further processing. This implementation uses jakarta commons-fileupload for parsing multipart requests. Maximum file size can be configured using the "maxFileSize" init parameter, defaulting to 2 GB.

Version:
$Id: MultipartRequestFilter.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
Andreas Brenk, Fabrizio Giustina

Constructor Summary
MultipartRequestFilter()
           
 
Method Summary
 void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
          Determine if the request has multipart content and if so parse it into a MultipartForm and store it as a request attribute.
 void init(javax.servlet.FilterConfig config)
           
 
Methods inherited from class info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter
bypasses, doFilter
 
Methods inherited from class info.magnolia.cms.filters.AbstractMgnlFilter
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, addMapping, destroy, getBypasses, getDispatching, getMapping, getMappings, getName, headerContains, isEnabled, mapsTo, matches, matchesDispatching, setDispatching, setEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipartRequestFilter

public MultipartRequestFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class AbstractMgnlFilter
Throws:
javax.servlet.ServletException
See Also:
Filter.init(javax.servlet.FilterConfig)

doFilter

public void doFilter(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Determine if the request has multipart content and if so parse it into a MultipartForm and store it as a request attribute.

Specified by:
doFilter in class AbstractMgnlFilter
Throws:
IOException
javax.servlet.ServletException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.