|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.http.entity.AbstractHttpEntityHC4
org.apache.http.entity.StringEntityHC4
@NotThreadSafe public class StringEntityHC4
A self contained, repeatable entity that obtains its content from
a String.
| Field Summary | |
|---|---|
protected byte[] |
content
|
| Fields inherited from class org.apache.http.entity.AbstractHttpEntityHC4 |
|---|
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE |
| Constructor Summary | |
|---|---|
StringEntityHC4(java.lang.String string)
Creates a StringEntityHC4 with the specified content. |
|
StringEntityHC4(java.lang.String string,
java.nio.charset.Charset charset)
Creates a StringEntityHC4 with the specified content and charset. |
|
StringEntityHC4(java.lang.String string,
ContentType contentType)
Creates a StringEntityHC4 with the specified content and content type. |
|
StringEntityHC4(java.lang.String string,
java.lang.String charset)
Creates a StringEntityHC4 with the specified content and charset. |
|
StringEntityHC4(java.lang.String string,
java.lang.String mimeType,
java.lang.String charset)
Deprecated. (4.1.3) use StringEntityHC4(String, ContentType) |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
java.io.InputStream |
getContent()
|
long |
getContentLength()
|
boolean |
isRepeatable()
|
boolean |
isStreaming()
Tells that this entity is not streaming. |
void |
writeTo(java.io.OutputStream outstream)
|
| Methods inherited from class org.apache.http.entity.AbstractHttpEntityHC4 |
|---|
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final byte[] content
| Constructor Detail |
|---|
public StringEntityHC4(java.lang.String string,
ContentType contentType)
throws java.nio.charset.UnsupportedCharsetException
string - content to be used. Not null.contentType - content type to be used. May be null, in which case the default
MIME type ContentType.TEXT_PLAIN is assumed.
java.lang.IllegalArgumentException - if the string parameter is null
java.nio.charset.UnsupportedCharsetException - Thrown when the named charset is not available in
this instance of the Java virtual machine
@Deprecated
public StringEntityHC4(java.lang.String string,
java.lang.String mimeType,
java.lang.String charset)
throws java.io.UnsupportedEncodingException
StringEntityHC4(String, ContentType)
string - content to be used. Not null.mimeType - MIME type to be used. May be null, in which case the default
is HTTP.PLAIN_TEXT_TYPE i.e. "text/plain"charset - character set to be used. May be null, in which case the default
is HTTP.DEFAULT_CONTENT_CHARSET i.e. "ISO-8859-1"
java.io.UnsupportedEncodingException - If the named charset is not supported.
java.lang.IllegalArgumentException - if the string parameter is null
public StringEntityHC4(java.lang.String string,
java.lang.String charset)
throws java.nio.charset.UnsupportedCharsetException
string - content to be used. Not null.charset - character set to be used. May be null, in which case the default
is HTTP.DEFAULT_CONTENT_CHARSET is assumed
java.lang.IllegalArgumentException - if the string parameter is null
java.nio.charset.UnsupportedCharsetException - Thrown when the named charset is not available in
this instance of the Java virtual machine
public StringEntityHC4(java.lang.String string,
java.nio.charset.Charset charset)
string - content to be used. Not null.charset - character set to be used. May be null, in which case the default
is HTTP.DEFAULT_CONTENT_CHARSET is assumed
java.lang.IllegalArgumentException - if the string parameter is null
public StringEntityHC4(java.lang.String string)
throws java.io.UnsupportedEncodingException
ContentType.TEXT_PLAIN.
string - content to be used. Not null.
java.lang.IllegalArgumentException - if the string parameter is null
java.io.UnsupportedEncodingException - if the default HTTP charset is not supported.| Method Detail |
|---|
public boolean isRepeatable()
isRepeatable in interface org.apache.http.HttpEntitypublic long getContentLength()
getContentLength in interface org.apache.http.HttpEntity
public java.io.InputStream getContent()
throws java.io.IOException
getContent in interface org.apache.http.HttpEntityjava.io.IOException
public void writeTo(java.io.OutputStream outstream)
throws java.io.IOException
writeTo in interface org.apache.http.HttpEntityjava.io.IOExceptionpublic boolean isStreaming()
isStreaming in interface org.apache.http.HttpEntityfalse
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||