org.codehaus.plexus.summit.parameters
Class RequestParameters
java.lang.Object
org.codehaus.plexus.summit.parameters.BaseParameterConverter
org.codehaus.plexus.summit.parameters.RequestParameters
- All Implemented Interfaces:
- ParameterConverter
- public class RequestParameters
- extends BaseParameterConverter
Provides numerous convienence methods which operate on a map of
parameters contained within this object. The parameters represent
the parameters associated with an HTTP request. These parameters
not only include simple form items, but also contain any uploaded
files associated with the request.
- Version:
- $Revision: 2083 $
- Author:
- Pete Kazmier
Constructor Summary |
RequestParameters(java.util.Map parameters)
Constructor that takes a map of parameters and uses the default
character encoding, "US-ASCII", when converting to byte arrays. |
RequestParameters(java.util.Map parameters,
java.lang.String characterEncoding)
Constructor that takes a map of parameters and a character encoding
that is used when converting to byte arrays. |
Method Summary |
org.apache.commons.fileupload.FileItem |
getFileItem(java.lang.String name)
Get the FileItem, which represents a file that was uploaded as
part of an HTTP request, associated with the specified parameter name. |
org.apache.commons.fileupload.FileItem[] |
getFileItems(java.lang.String name)
Get the FileItem[]s, which represents one or more files that
were uploaded as part of an HTTP request, associated with the specified
parameter name. |
Methods inherited from class org.codehaus.plexus.summit.parameters.BaseParameterConverter |
containsKey, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getObject, getObjects, getParametersMap, getString, getString, getStrings, getStrings, keys, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RequestParameters
public RequestParameters(java.util.Map parameters)
- Constructor that takes a map of parameters and uses the default
character encoding, "US-ASCII", when converting to byte arrays.
The map of parameters must contain name/value pairs. Each value
must be an array of Strings or FileItems
even if there is only a single value for the parameter.
- Parameters:
parameters
- A map of name/value pairs representing parameters.
- Throws:
java.lang.NullPointerException
- If the parameters map is null.
RequestParameters
public RequestParameters(java.util.Map parameters,
java.lang.String characterEncoding)
- Constructor that takes a map of parameters and a character encoding
that is used when converting to byte arrays. The map of parameters
must contain name/value pairs. Each value must be an array
of Strings or FileItems even if there is only a
single value for the parameter.
- Parameters:
parameters
- A map of name/value pairs representing parameters.characterEncoding
- The character encoding used to convert byte arrays.
- Throws:
java.lang.NullPointerException
- If the parameters map is null, or if
specified character encoding is null.
getFileItem
public org.apache.commons.fileupload.FileItem getFileItem(java.lang.String name)
- Get the FileItem, which represents a file that was uploaded as
part of an HTTP request, associated with the specified parameter name.
- Parameters:
name
- The name of the parameter containing the file uploaded.
- Returns:
- FileItem A file item representing the uploaded file. If the
name does not exist, or if the parameter does not represent
an uploaded file, null is returned.
getFileItems
public org.apache.commons.fileupload.FileItem[] getFileItems(java.lang.String name)
- Get the FileItem[]s, which represents one or more files that
were uploaded as part of an HTTP request, associated with the specified
parameter name.
- Parameters:
name
- The name of the parameter containing the file(s) uploaded.
- Returns:
- FileItem[] An array of file items containing the files uploaded.
If the name does not exist, or if the parameter does not
represent an uploaded file, null is returned.
Copyright © 2001-2007 Codehaus. All Rights Reserved.