org.mortbay.servlet
Class MultiPartFilter

java.lang.Object
  extended by org.mortbay.servlet.MultiPartFilter
All Implemented Interfaces:
Filter

public class MultiPartFilter
extends Object
implements Filter

Multipart Form Data Filter.

This class decodes the multipart/form-data stream sent by a HTML form that uses a file input item. Any files sent are stored to a tempary file and a File object added to the request as an attribute. All other values are made available via the normal getParameter API and the setCharacterEncoding mechanism is respected when converting bytes to Strings.

Author:
Greg Wilkins, Jim Crossley

Nested Class Summary
private static class MultiPartFilter.Wrapper
           
 
Field Summary
private  File tempdir
           
 
Constructor Summary
MultiPartFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void init(FilterConfig filterConfig)
           
private  String value(String nameEqualsValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tempdir

private File tempdir
Constructor Detail

MultiPartFilter

public MultiPartFilter()
Method Detail

init

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

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException
See Also:
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)

value

private String value(String nameEqualsValue)

destroy

public void destroy()
Specified by:
destroy in interface Filter
See Also:
Filter.destroy()