com.oreilly.servlet.multipart
Class ParamPart

java.lang.Object
  extended by com.oreilly.servlet.multipart.Part
      extended by com.oreilly.servlet.multipart.ParamPart

public class ParamPart
extends Part

A ParamPart is an upload part which represents a normal INPUT (for example a non TYPE="file") form parameter.

Version:
1.1, 2002/04/30, added better encoding support, thanks to Changshin Lee, 1.0, 2000/10/27, initial revision
Author:
Geoff Soutter, Jason Hunter

Method Summary
 java.lang.String getStringValue()
          Returns the value of the parameter in as a string (using the parser-specified encoding to convert from bytes) or the empty string if the user entered no value for this parameter.
 java.lang.String getStringValue(java.lang.String encoding)
          Returns the value of the parameter in the supplied encoding or empty string if the user entered no value for this parameter.
 byte[] getValue()
          Returns the value of the parameter as an array of bytes or a zero length array if the user entered no value for this parameter.
 boolean isParam()
          Returns true to indicate this part is a parameter.
 
Methods inherited from class com.oreilly.servlet.multipart.Part
getName, isFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValue

public byte[] getValue()
Returns the value of the parameter as an array of bytes or a zero length array if the user entered no value for this parameter.

Returns:
value of parameter as raw bytes

getStringValue

public java.lang.String getStringValue()
                                throws java.io.UnsupportedEncodingException
Returns the value of the parameter in as a string (using the parser-specified encoding to convert from bytes) or the empty string if the user entered no value for this parameter.

Returns:
value of parameter as a string.
Throws:
java.io.UnsupportedEncodingException

getStringValue

public java.lang.String getStringValue(java.lang.String encoding)
                                throws java.io.UnsupportedEncodingException
Returns the value of the parameter in the supplied encoding or empty string if the user entered no value for this parameter.

Returns:
value of parameter as a string.
Throws:
java.io.UnsupportedEncodingException

isParam

public boolean isParam()
Returns true to indicate this part is a parameter.

Overrides:
isParam in class Part
Returns:
true.