String.
| Modifier and Type | Field and Description |
|---|---|
| protected final byte[] |
| Access | Constructor and Description |
|---|---|
| public | StringEntity(final String
content to be used. Not string, final ContentType null.content type to be used. May be contentType)null, in which case the default
MIME type ContentType#TEXT_PLAIN is assumed.Creates a StringEntity with the specified content and content type. |
| public | StringEntity(final String
content to be used. Not string, final String null.MIME type to be used. May be mimeType, final String null, in which case the default
is HTTP#PLAIN_TEXT_TYPE i.e. "text/plain"character set to be used. May be charset)null, in which case the default
is HTTP#DEF_CONTENT_CHARSET i.e. "ISO-8859-1"
Deprecated
(4.1.3) use
Creates a StringEntity with the specified content, MIME type and charset
StringEntity(String, ContentType)
|
| public | StringEntity(final String
content to be used. Not string, final String null.character set to be used. May be charset)null, in which case the default
is HTTP#DEF_CONTENT_CHARSET is assumedCreates a StringEntity with the specified content and charset. |
| public | StringEntity(final String
content to be used. Not string, final Charset null.character set to be used. May be charset)null, in which case the default
is HTTP#DEF_CONTENT_CHARSET is assumedCreates a StringEntity with the specified content and charset. |
| public | StringEntity(final String
content to be used. Not string)null.Creates a StringEntity with the specified content. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public InputStream | getContent()
Implements org. |
| public long | getContentLength()
Implements org. |
| public boolean | isRepeatable()
Implements org. |
| public boolean | Returns: falseImplements org. |
| public void | writeTo(final OutputStream
the output stream to write entity content to outStream)Implements org. |
| content | back to summary |
|---|---|
| protected final byte[] content | |
| StringEntity | back to summary |
|---|---|
| public StringEntity(final String string, final ContentType contentType) throws UnsupportedCharsetException Creates a StringEntity with the specified content and content type.
| |
| StringEntity | back to summary |
|---|---|
| public StringEntity(final String string, final String mimeType, final String charset) throws UnsupportedEncodingException
Deprecated (4.1.3) use Creates a StringEntity with the specified content, MIME type and charset
| |
| StringEntity | back to summary |
|---|---|
| public StringEntity(final String string, final String charset) throws UnsupportedCharsetException Creates a StringEntity with the specified content and charset. The MIME type defaults to "text/plain".
| |
| StringEntity | back to summary |
|---|---|
| public StringEntity(final String string, final Charset charset) Creates a StringEntity with the specified content and charset. The MIME type defaults to "text/plain".
| |
| StringEntity | back to summary |
|---|---|
| public StringEntity(final String string) throws UnsupportedEncodingException Creates a StringEntity with the specified content. The content type defaults to
| |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getContent | back to summary |
|---|---|
| public InputStream getContent() throws IOException Implements org. Doc from org. Returns a content stream of the entity.
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. Doc from org. Tells the length of the content, if known.
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Implements org. Doc from org. Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
| |
| isStreaming | back to summary |
|---|---|
| public boolean isStreaming() Implements org. Tells that this entity is not streaming.
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(final OutputStream outStream) throws IOException Implements org. Doc from org. Writes the entity content out to the output stream. Important Note Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
| |