Class StringPart
- java.lang.Object
-
- org.apache.commons.httpclient.methods.multipart.Part
-
- org.apache.commons.httpclient.methods.multipart.PartBase
-
- org.apache.commons.httpclient.methods.multipart.StringPart
-
public class StringPart extends PartBase
Simple string parameter for a multipart post- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_CHARSETDefault charset of string parametersstatic java.lang.StringDEFAULT_CONTENT_TYPEDefault content encoding of string parameters.static java.lang.StringDEFAULT_TRANSFER_ENCODINGDefault transfer encoding of string parameters
-
Constructor Summary
Constructors Constructor Description StringPart(java.lang.String name, java.lang.String value)Constructor.StringPart(java.lang.String name, java.lang.String value, java.lang.String charset)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetCharSet(java.lang.String charSet)Sets the character encoding.-
Methods inherited from class org.apache.commons.httpclient.methods.multipart.PartBase
getCharSet, getContentType, getName, getTransferEncoding, setContentType, setName, setTransferEncoding
-
Methods inherited from class org.apache.commons.httpclient.methods.multipart.Part
getBoundary, getLengthOfParts, getLengthOfParts, isRepeatable, length, send, sendParts, sendParts, toString
-
-
-
-
Field Detail
-
DEFAULT_CONTENT_TYPE
public static final java.lang.String DEFAULT_CONTENT_TYPE
Default content encoding of string parameters.- See Also:
- Constant Field Values
-
DEFAULT_CHARSET
public static final java.lang.String DEFAULT_CHARSET
Default charset of string parameters- See Also:
- Constant Field Values
-
DEFAULT_TRANSFER_ENCODING
public static final java.lang.String DEFAULT_TRANSFER_ENCODING
Default transfer encoding of string parameters- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringPart
public StringPart(java.lang.String name, java.lang.String value, java.lang.String charset)Constructor.- Parameters:
name- The name of the partvalue- the string to postcharset- the charset to be used to encode the string, ifnullthedefaultis used
-
StringPart
public StringPart(java.lang.String name, java.lang.String value)Constructor.- Parameters:
name- The name of the partvalue- the string to post
-
-
Method Detail
-
setCharSet
public void setCharSet(java.lang.String charSet)
Description copied from class:PartBaseSets the character encoding.- Overrides:
setCharSetin classPartBase- Parameters:
charSet- the character encoding, ornullto exclude the character encoding header
-
-