Class MultipartWrapper
- java.lang.Object
-
- org.apache.manifoldcf.ui.multipart.MultipartWrapper
-
- All Implemented Interfaces:
IParameterActivity
,IPasswordMapperActivity
,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
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected AdminProfile
adminProfile
The Admin Profile bean, for password mapping.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
Constructors Constructor Description MultipartWrapper(javax.servlet.http.HttpServletRequest request, AdminProfile adminProfile)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.String
mapKeyToPassword(java.lang.String key)
Convert a key, created by mapPasswordToKey, back to the original password, within the lifetime of the browser session.java.lang.String
mapPasswordToKey(java.lang.String password)
Map a password to a unique key.void
setParameter(java.lang.String name, java.lang.String value)
Set a parameter valuevoid
setParameterValues(java.lang.String name, java.lang.String[] values)
Set an array of parameter values
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
adminProfile
protected final AdminProfile adminProfile
The Admin Profile bean, for password mapping.
-
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, AdminProfile adminProfile) 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 interfaceIParameterActivity
- 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 interfaceIParameterActivity
- 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 interfaceIParameterActivity
- 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 interfaceIParameterActivity
- 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 interfaceIParameterActivity
- 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 interfaceIParameterActivity
- Parameters:
name
- is the parameter name.values
- is the array of desired values.
-
mapPasswordToKey
public java.lang.String mapPasswordToKey(java.lang.String password)
Map a password to a unique key. This method works within a specific given browser session to replace an existing password with a key which can be used to look up the password at a later time.- Specified by:
mapPasswordToKey
in interfaceIPasswordMapperActivity
- Parameters:
password
- is the password.- Returns:
- the key.
-
mapKeyToPassword
public java.lang.String mapKeyToPassword(java.lang.String key)
Convert a key, created by mapPasswordToKey, back to the original password, within the lifetime of the browser session. If the provided key is not an actual key, instead the key value is assumed to be a new password value.- Specified by:
mapKeyToPassword
in interfaceIPasswordMapperActivity
- Parameters:
key
- is the key.- Returns:
- the password.
-
-