public class DefaultMultipartWrapperFactory extends java.lang.Object implements MultipartWrapperFactory
Default implementation of a factory for MultipartWrappers. Looks up a class name in
Configuration under the key specified by WRAPPER_CLASS_NAME
. If no class
name is configured, defaults to the CosMultipartWrapper
. An additional configuration
parameter is supported to specify the maximum post size allowable.
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
BUNDLED_IMPLEMENTATIONS
The names of the MultipartWrapper classes that will be tried if no other is specified.
|
static java.lang.String |
MAX_POST
Key used to lookup the name of the maximum post size.
|
static java.lang.String |
WRAPPER_CLASS_NAME
The configuration key used to lookup the implementation of MultipartWrapper.
|
Constructor and Description |
---|
DefaultMultipartWrapperFactory() |
Modifier and Type | Method and Description |
---|---|
void |
init(Configuration config)
Invoked directly after instantiation to allow the configured component to perform one time
initialization.
|
MultipartWrapper |
wrap(javax.servlet.http.HttpServletRequest request)
Wraps the request in an appropriate implementation of MultipartWrapper that is capable of
providing access to request parameters and any file parts contained within the request.
|
public static final java.lang.String WRAPPER_CLASS_NAME
public static final java.lang.String[] BUNDLED_IMPLEMENTATIONS
public static final java.lang.String MAX_POST
public void init(Configuration config) throws java.lang.Exception
init
in interface ConfigurableComponent
config
- the Configuration object being used by Stripesjava.lang.Exception
- should be thrown if the component cannot be configured well enough to use.public MultipartWrapper wrap(javax.servlet.http.HttpServletRequest request) throws java.io.IOException, FileUploadLimitExceededException
wrap
in interface MultipartWrapperFactory
request
- an active HttpServletRequestjava.io.IOException
- if encountered when consuming the contents of the requestFileUploadLimitExceededException
- if the post size of the request exceeds any
configured limits? Copyright 2005-2006, Stripes Development Team.