public class StringBody extends AbstractContentBody
MultipartEntityBuilder| Constructor and Description |
|---|
StringBody(java.lang.String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(java.lang.String text,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(java.lang.String text,
ContentType contentType) |
StringBody(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
| Modifier and Type | Method and Description |
|---|---|
static StringBody |
create(java.lang.String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(java.lang.String text,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
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) |
getCharset, getContentType, getMediaType, getMimeType, getSubType@Deprecated
public StringBody(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuildertext - to be used for the body, not nullmimeType - the MIME type, not nullcharset - the character set, may be null, in which case the US-ASCII charset is usedjava.io.UnsupportedEncodingExceptionjava.lang.IllegalArgumentException - if the text parameter is null@Deprecated
public StringBody(java.lang.String text,
java.nio.charset.Charset charset)
throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuildertext - to be used for the body, not nullcharset - the character set, may be null, in which case the US-ASCII charset is usedjava.io.UnsupportedEncodingExceptionjava.lang.IllegalArgumentException - if the text parameter is null@Deprecated
public StringBody(java.lang.String text)
throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuildertext - to be used for the body, not nulljava.io.UnsupportedEncodingExceptionjava.lang.IllegalArgumentException - if the text parameter is nullpublic StringBody(java.lang.String text,
ContentType contentType)
@Deprecated public static StringBody create(java.lang.String text, java.lang.String mimeType, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilderjava.lang.IllegalArgumentException@Deprecated public static StringBody create(java.lang.String text, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilderjava.lang.IllegalArgumentException@Deprecated public static StringBody create(java.lang.String text) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilderjava.lang.IllegalArgumentExceptionpublic java.io.Reader getReader()
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getTransferEncoding()
ContentDescriptorpublic long getContentLength()
ContentDescriptorpublic java.lang.String getFilename()