|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.entity.mime.content.AbstractContentBody
org.apache.http.entity.mime.content.StringBody
public class StringBody
Constructor Summary | |
---|---|
StringBody(java.lang.String text)
Create a StringBody from the specified text. |
|
StringBody(java.lang.String text,
java.nio.charset.Charset charset)
Create a StringBody from the specified text and character set. |
|
StringBody(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
Create a StringBody from the specified text, mime type and character set. |
Method Summary | |
---|---|
static StringBody |
create(java.lang.String text)
|
static StringBody |
create(java.lang.String text,
java.nio.charset.Charset charset)
|
static StringBody |
create(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
|
java.lang.String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME type. |
long |
getContentLength()
Returns the body descriptors content-length. |
java.lang.String |
getFilename()
|
java.io.Reader |
getReader()
|
java.lang.String |
getTransferEncoding()
Returns the body descriptors transfer encoding. |
void |
writeTo(java.io.OutputStream out)
|
void |
writeTo(java.io.OutputStream out,
int mode)
Deprecated. use writeTo(OutputStream) |
Methods inherited from class org.apache.http.entity.mime.content.AbstractContentBody |
---|
getMediaType, getMimeType, getSubType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringBody(java.lang.String text, java.lang.String mimeType, java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
text
- to be used for the body, not null
mimeType
- the mime type, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is used
java.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is nullpublic StringBody(java.lang.String text, java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
text
- to be used for the body, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is used
java.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is nullpublic StringBody(java.lang.String text) throws java.io.UnsupportedEncodingException
text
- to be used for the body, not null
java.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is nullMethod Detail |
---|
public static StringBody create(java.lang.String text, java.lang.String mimeType, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static StringBody create(java.lang.String text, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static StringBody create(java.lang.String text) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.io.Reader getReader()
@Deprecated public void writeTo(java.io.OutputStream out, int mode) throws java.io.IOException
writeTo(OutputStream)
java.io.IOException
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public java.lang.String getTransferEncoding()
ContentDescriptor
public java.lang.String getCharset()
ContentDescriptor
The body descriptors character set, defaulted appropriately for the MIME type.
For TEXT
types, this will be defaulted to us-ascii
.
For other types, when the charset parameter is missing this property will be null.
TEXT
types, when unset will
be set to default us-ascii
. For other types, when unset,
null will be returned.public long getContentLength()
ContentDescriptor
public java.lang.String getFilename()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |