org.springframework.web.multipart.cos
Class CosMultipartResolver

org.springframework.context.support.ApplicationObjectSupport
  |
  +--org.springframework.web.context.support.WebApplicationObjectSupport
        |
        +--org.springframework.web.multipart.cos.CosMultipartResolver

public class CosMultipartResolver
extends WebApplicationObjectSupport
implements MultipartResolver

MultipartResolver implementation for Jason Hunter's COS (com.oreilly.servlet). Works with a COS MultipartRequest underneath.

Provides maxUploadSize and headerEncoding settings as bean properties; see respective MultipartRequest constructor parameters for details. Default maximum file size is unlimited; default encoding is the platform's default.

Author:
Juergen Hoeller
Since: 06.10.2003
See Also: CosMultipartHttpServletRequest, com.oreilly.servlet.MultipartRequest

Field Summary
 final static StringMULTIPART_CONTENT_TYPE
           

Constructor Summary
CosMultipartResolver()
          Constructor for use as bean in an application context.
CosMultipartResolver(ServletContext servletContext)
          Constructor for standalone usage.

Method Summary
 voidcleanupMultipart(MultipartHttpServletRequest request)
           
 booleanisMultipart(HttpServletRequest request)
           
 MultipartHttpServletRequestresolveMultipart(HttpServletRequest request)
           
 voidsetHeaderEncoding(String headerEncoding)
          Set the character encoding to be used when reading the headers of individual parts.
 voidsetMaxUploadSize(int maxUploadSize)
          Set the maximum allowed file size (in bytes) before uploads are refused.
 voidsetUploadTempDir(Resource uploadTempDir)
          Set the temporary directory where uploaded files get stored.

Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, setApplicationContext

Field Detail

MULTIPART_CONTENT_TYPE

public final static String MULTIPART_CONTENT_TYPE
Constructor Detail

CosMultipartResolver

public CosMultipartResolver()
Constructor for use as bean in an application context. Determines the servlet container's temporary directory via the application context.

CosMultipartResolver

public CosMultipartResolver(ServletContext servletContext)
Constructor for standalone usage. Determines the servlet container's temporary directory via the given ServletContext.
Method Detail

cleanupMultipart

public void cleanupMultipart(MultipartHttpServletRequest request)

isMultipart

public boolean isMultipart(HttpServletRequest request)

resolveMultipart

public MultipartHttpServletRequest resolveMultipart(HttpServletRequest request)
throws org.springframework.web.multipart.MultipartException

setHeaderEncoding

public void setHeaderEncoding(String headerEncoding)
Set the character encoding to be used when reading the headers of individual parts. When not specified, or null, the platform default encoding is used.
Parameters:
headerEncoding - the character encoding to use
See Also:
org.apache.commons.fileupload.FileUploadBase#setHeaderEncoding

setMaxUploadSize

public void setMaxUploadSize(int maxUploadSize)
Set the maximum allowed file size (in bytes) before uploads are refused. -1 indicates no limit (the default).
Parameters:
maxUploadSize - the maximum file size allowed

setUploadTempDir

public void setUploadTempDir(Resource uploadTempDir)
throws java.io.IOException
Set the temporary directory where uploaded files get stored. Default is the servlet container's temporary directory for the web application.
See Also:
org.springframework.web.util.WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.io.File