java.lang.Object | |
↳ | org.apache.http.util.EntityUtils |
Static helpers for dealing with HttpEntity
s.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Ensures that the entity content is fully consumed and the content stream, if exists,
is closed.
| |||||||||||
Obtains character set of the entity, if known.
| |||||||||||
Obtains mime type of the entity, if known.
| |||||||||||
Read the contents of an entity and return it as a byte array.
| |||||||||||
Get the entity content as a String, using the provided default character set
if none is found in the entity.
| |||||||||||
Read the contents of an entity and return it as a String.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Ensures that the entity content is fully consumed and the content stream, if exists, is closed.
IOException | if an error occurs reading the input stream |
---|
Obtains character set of the entity, if known.
entity | must not be null |
---|
ParseException | if header elements cannot be parsed |
---|---|
IllegalArgumentException | if entity is null |
Obtains mime type of the entity, if known.
entity | must not be null |
---|
ParseException | if header elements cannot be parsed |
---|---|
IllegalArgumentException | if entity is null |
Read the contents of an entity and return it as a byte array.
getContent()
is null.IOException | if an error occurs reading the input stream |
---|---|
IllegalArgumentException | if entity is null or if content length > Integer.MAX_VALUE |
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.
entity | must not be null |
---|---|
defaultCharset | character set to be applied if none found in the entity |
getContent()
is null.ParseException | if header elements cannot be parsed |
---|---|
IllegalArgumentException | if entity is null or if content length > Integer.MAX_VALUE |
IOException | if an error occurs reading the input stream |
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.
ParseException | if header elements cannot be parsed |
---|---|
IllegalArgumentException | if entity is null or if content length > Integer.MAX_VALUE |
IOException | if an error occurs reading the input stream |