|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.multipart.Part com.ning.http.multipart.PartBase com.ning.http.multipart.StringPart
public class StringPart
This class is an adaptation of the Apache HttpClient implementation
Field Summary | |
---|---|
static String |
DEFAULT_CHARSET
Default charset of string parameters |
static String |
DEFAULT_CONTENT_TYPE
Default content encoding of string parameters. |
static String |
DEFAULT_TRANSFER_ENCODING
Default transfer encoding of string parameters |
Fields inherited from class com.ning.http.multipart.Part |
---|
CHARSET, CHARSET_BYTES, CONTENT_DISPOSITION, CONTENT_DISPOSITION_BYTES, CONTENT_ID, CONTENT_ID_BYTES, CONTENT_TRANSFER_ENCODING, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE, CONTENT_TYPE_BYTES, CRLF, CRLF_BYTES, EXTRA, EXTRA_BYTES, FORM_DATA_DISPOSITION_TYPE, FORM_DATA_DISPOSITION_TYPE_BYTES, NAME, NAME_BYTES, QUOTE, QUOTE_BYTES |
Constructor Summary | |
---|---|
StringPart(String name,
String value)
Constructor. |
|
StringPart(String name,
String value,
String charset)
|
|
StringPart(String name,
String value,
String charset,
String contentId)
Constructor. |
Method Summary | |
---|---|
protected long |
lengthOfData()
Return the length of the data. |
protected void |
sendData(OutputStream out)
Writes the data to the given OutputStream. |
void |
setCharSet(String charSet)
Sets the character encoding. |
Methods inherited from class com.ning.http.multipart.PartBase |
---|
getCharSet, getContentId, getContentType, getName, getTransferEncoding, setContentId, setContentType, setName, setTransferEncoding |
Methods inherited from class com.ning.http.multipart.Part |
---|
contentIdHeaderLength, contentTypeHeaderLength, dispositionHeaderLength, endLength, endOfHeaderLength, getDispositionType, getLengthOfParts, length, send, sendContentIdHeader, sendContentTypeHeader, sendDispositionHeader, sendEnd, sendEndOfHeader, sendMessageEnd, sendPart, sendParts, sendStart, sendTransferEncodingHeader, setDispositionType, toString, transferEncodingHeaderLength |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CONTENT_TYPE
public static final String DEFAULT_CHARSET
public static final String DEFAULT_TRANSFER_ENCODING
Constructor Detail |
---|
public StringPart(String name, String value, String charset, String contentId)
name
- The name of the partvalue
- the string to postcharset
- the charset to be used to encode the string, if null
the default
is usedpublic StringPart(String name, String value, String charset)
public StringPart(String name, String value)
name
- The name of the partvalue
- the string to postMethod Detail |
---|
protected void sendData(OutputStream out) throws IOException
sendData
in class Part
out
- the OutputStream to write to
IOException
- if there is a write errorprotected long lengthOfData()
lengthOfData
in class Part
public void setCharSet(String charSet)
PartBase
setCharSet
in class PartBase
charSet
- the character encoding, or null
to exclude the character encoding header
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |