org.apache.droids.protocol.http
Class HttpContentEntity

java.lang.Object
  extended by org.apache.droids.protocol.http.HttpContentEntity
All Implemented Interfaces:
ContentEntity, ManagedContentEntity

public class HttpContentEntity
extends java.lang.Object
implements ManagedContentEntity


Constructor Summary
HttpContentEntity(org.apache.http.HttpEntity entity)
           
 
Method Summary
 void finish()
          Releases all underlying resources held by the entity.
 java.lang.String getCharset()
          Returns charset of the entity if known.
 java.lang.String getMimeType()
          Returns MIME type of the entity.
 Parse getParse()
          Returns the parse object from a former processing step May be null if not available.
 java.io.InputStream obtainContent()
          Returns content of the entity as an input stream.
 void setParse(Parse parse)
          Sets the parse object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpContentEntity

public HttpContentEntity(org.apache.http.HttpEntity entity)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getMimeType

public java.lang.String getMimeType()
Description copied from interface: ContentEntity
Returns MIME type of the entity.

Specified by:
getMimeType in interface ContentEntity
Returns:
MIME type

getCharset

public java.lang.String getCharset()
Description copied from interface: ContentEntity
Returns charset of the entity if known. Otherwise returns null.

Specified by:
getCharset in interface ContentEntity
Returns:
charset

obtainContent

public java.io.InputStream obtainContent()
                                  throws java.io.IOException
Description copied from interface: ContentEntity
Returns content of the entity as an input stream. This input stream MUST be closed by the consumer when finished reading content.

IMPORTANT: This method MUST return a new instance of InputStream to ensure the content can be consumed more than once.

Specified by:
obtainContent in interface ContentEntity
Returns:
input stream
Throws:
java.io.IOException

getParse

public Parse getParse()
Description copied from interface: ContentEntity
Returns the parse object from a former processing step May be null if not available.

Specified by:
getParse in interface ContentEntity
Returns:
parse object

setParse

public void setParse(Parse parse)
Description copied from interface: ManagedContentEntity
Sets the parse object.

Specified by:
setParse in interface ManagedContentEntity

finish

public void finish()
Description copied from interface: ManagedContentEntity
Releases all underlying resources held by the entity.

Specified by:
finish in interface ManagedContentEntity


Copyright © 2007-2009. All Rights Reserved.