HttpEntitys.
| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | consume(final HttpEntity
the entity to consume. entity)Ensures that the entity content is fully consumed and the content stream, if exists, is closed. |
| public static void | consumeQuietly(final HttpEntity
the entity to consume. entity)Ensures that the entity content is fully consumed and the content stream, if exists, is closed. |
| public static String | Returns: the character set, or null if not foundmust not be null entity)
Deprecated
(4.1.3) use
Obtains character set of the entity, if known.
ContentType#getOrDefault(HttpEntity)
|
| public static String | Returns: the character set, or null if not foundmust not be null entity)
Deprecated
(4.1.3) use
Obtains MIME type of the entity, if known.
ContentType#getOrDefault(HttpEntity)
|
| public static byte[] | Returns: byte array containing the entity content. May be null ifHttpEntity#getContent() is null.the entity to read from= entity)Read the contents of an entity and return it as a byte array. |
| private static String | |
| public static String | Returns: the entity content as a String. May be null ifHttpEntity#getContent() is null.must not be null entity, final Charset character set to be applied if none found in the entity,
or if the entity provided charset is invalid or not available. defaultCharset)Get the entity content as a String, using the provided default character set if none is found in the entity. |
| public static String | Returns: the entity content as a String. May be null ifHttpEntity#getContent() is null.must not be null entity, final String character set to be applied if none found in the entity defaultCharset)Get the entity content as a String, using the provided default character set if none is found in the entity. |
| public static String | Returns: String containing the content.the entity to convert to a string; must not be null entity)Read the contents of an entity and return it as a String. |
| public static void | updateEntity(final HttpResponse
the response with an entity to update; must not be null. response, final HttpEntity the entity to set in the response. entity)Updates an entity in a response by first consuming an existing entity, then setting the new one. |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_BUFFER_SIZE | |
| EntityUtils | back to summary |
|---|---|
| private EntityUtils() | |
| consume | back to summary |
|---|---|
| public static void consume(final HttpEntity entity) throws IOException Ensures that the entity content is fully consumed and the content stream, if exists, is closed.
| |
| consumeQuietly | back to summary |
|---|---|
| public static void consumeQuietly(final HttpEntity entity) Ensures that the entity content is fully consumed and the content stream, if exists, is closed. The process is done, quietly , without throwing any IOException.
| |
| getContentCharSet | back to summary |
|---|---|
| public static String getContentCharSet(final HttpEntity entity) throws ParseException
Deprecated (4.1.3) use Obtains character set of the entity, if known.
| |
| getContentMimeType | back to summary |
|---|---|
| public static String getContentMimeType(final HttpEntity entity) throws ParseException
Deprecated (4.1.3) use Obtains MIME type of the entity, if known.
| |
| toByteArray | back to summary |
|---|---|
| public static byte[] toByteArray(final HttpEntity entity) throws IOException Read the contents of an entity and return it as a byte array.
| |
| toString | back to summary |
|---|---|
| private static String toString(final HttpEntity entity, final ContentType contentType) throws IOException | |
| toString | back to summary |
|---|---|
| public static String toString(final HttpEntity entity, final Charset defaultCharset) throws IOException, ParseException Get the entity content as a String, using the provided default character set if none is found in the entity. If defaultCharset is null, the default "ISO-8859-1" is used.
| |
| toString | back to summary |
|---|---|
| public static String toString(final HttpEntity entity, final String defaultCharset) throws IOException, ParseException Get the entity content as a String, using the provided default character set if none is found in the entity. If defaultCharset is null, the default "ISO-8859-1" is used.
| |
| toString | back to summary |
|---|---|
| public static String toString(final HttpEntity entity) throws IOException, ParseException Read the contents of an entity and return it as a String. The content is converted using the character set from the entity (if any), failing that, "ISO-8859-1" is used.
| |
| updateEntity | back to summary |
|---|---|
| public static void updateEntity(final HttpResponse response, final HttpEntity entity) throws IOException Updates an entity in a response by first consuming an existing entity, then setting the new one.
| |