org.apache.manifoldcf.ui.multipart
Class MultipartWrapper

java.lang.Object
  extended by org.apache.manifoldcf.ui.multipart.MultipartWrapper
All Implemented Interfaces:
IPostParameters

public class MultipartWrapper
extends java.lang.Object
implements IPostParameters

This class provides abstract parameter service, including support for uploaded files and multipart forms. It is styled much like HttpServletRequest, but wraps this interface so that code can access either standard post data or multipart data transparently.


Field Summary
static java.lang.String _rcsid
           
protected  java.lang.String characterEncoding
           
protected  javax.servlet.http.HttpServletRequest request
          This is the HttpServletRequest object, which will be used for parameters only if the form is not multipart.
protected  java.util.Map variableMap
           
 
Constructor Summary
MultipartWrapper(javax.servlet.http.HttpServletRequest request)
          Constructor.
 
Method Summary
 byte[] getBinaryBytes(java.lang.String name)
          Get file parameter, as a byte array.
 BinaryInput getBinaryStream(java.lang.String name)
          Get a file parameter, as a binary input.
 java.lang.String getParameter(java.lang.String name)
          Get single parameter value.
 java.lang.String[] getParameterValues(java.lang.String name)
          Get multiple parameter values.
 void setParameter(java.lang.String name, java.lang.String value)
          Set a parameter value
 void setParameterValues(java.lang.String name, java.lang.String[] values)
          Set an array of parameter values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request
This is the HttpServletRequest object, which will be used for parameters only if the form is not multipart.


variableMap

protected java.util.Map variableMap

characterEncoding

protected java.lang.String characterEncoding
Constructor Detail

MultipartWrapper

public MultipartWrapper(javax.servlet.http.HttpServletRequest request)
                 throws ManifoldCFException
Constructor.

Throws:
ManifoldCFException
Method Detail

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Get multiple parameter values.

Specified by:
getParameterValues in interface IPostParameters
Parameters:
name - is the parameter name.
Returns:
the array of values, or null if it doesn't exist.

getParameter

public java.lang.String getParameter(java.lang.String name)
Get single parameter value.

Specified by:
getParameter in interface IPostParameters
Parameters:
name - is the parameter name.
Returns:
the value, or null if it doesn't exist.

getBinaryStream

public BinaryInput getBinaryStream(java.lang.String name)
                            throws ManifoldCFException
Get a file parameter, as a binary input.

Specified by:
getBinaryStream in interface IPostParameters
Parameters:
name - is the parameter name.
Returns:
the value, or null if it doesn't exist.
Throws:
ManifoldCFException

getBinaryBytes

public byte[] getBinaryBytes(java.lang.String name)
Get file parameter, as a byte array.

Specified by:
getBinaryBytes in interface IPostParameters
Parameters:
name - is the parameter name.
Returns:
the binary parameter as an array of bytes.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Set a parameter value

Specified by:
setParameter in interface IPostParameters
Parameters:
name - is the parameter name.
value - is the desired value.

setParameterValues

public void setParameterValues(java.lang.String name,
                               java.lang.String[] values)
Set an array of parameter values

Specified by:
setParameterValues in interface IPostParameters
Parameters:
name - is the parameter name.
values - is the array of desired values.