base.types
Class Item

java.lang.Object
  extended by base.types.Item
All Implemented Interfaces:
IItem

public class Item
extends java.lang.Object
implements IItem

Concrete class which represents a base unit of data.


Constructor Summary
Item()
           
Item(org.apache.http.HttpEntity entity)
           
Item(java.io.InputStream content, java.lang.String contentType, java.lang.String contentEncoding, long length)
           
 
Method Summary
 java.io.InputStream getContent()
          Returns the raw InputStream of the data.
 java.lang.String getContentEncoding()
          Indicates this data's Content-Encoding.
 long getContentLength()
          Indicates the length of the data.
 java.lang.String getContentString()
          Represents the content's stream as a String.
 java.lang.String getContentType()
          Indicates this data's Content-Type.
 void setContent(java.io.InputStream content)
          Sets the InputStream which defines this data.
 void setContentEncoding(java.lang.String encoding)
          Sets the Content-Encoding of this data.
 void setContentLength(long length)
          Sets the Content-Length of this data.
 void setContentString(java.lang.String data)
          Sets the String that represents this data.
 void setContentType(java.lang.String type)
          Sets the Content-Type of this data.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Item

public Item()

Item

public Item(java.io.InputStream content,
            java.lang.String contentType,
            java.lang.String contentEncoding,
            long length)

Item

public Item(org.apache.http.HttpEntity entity)
Method Detail

getContentString

public java.lang.String getContentString()
Description copied from interface: IItem
Represents the content's stream as a String. NOTE: The data's InputStream may not be consumable after this

Specified by:
getContentString in interface IItem
Returns:
String represents the data as a String

setContentString

public void setContentString(java.lang.String data)
Description copied from interface: IItem
Sets the String that represents this data.

Specified by:
setContentString in interface IItem
Parameters:
data - is the String that represents this data

getContent

public java.io.InputStream getContent()
Description copied from interface: IItem
Returns the raw InputStream of the data.

Specified by:
getContent in interface IItem
Returns:
InputStream is the data's InputStream

setContent

public void setContent(java.io.InputStream content)
Description copied from interface: IItem
Sets the InputStream which defines this data.

Specified by:
setContent in interface IItem
Parameters:
content - is the InputStream to define the data

getContentType

public java.lang.String getContentType()
Description copied from interface: IItem
Indicates this data's Content-Type.

Specified by:
getContentType in interface IItem
Returns:
String defines this data's Content-Type.

setContentType

public void setContentType(java.lang.String type)
Description copied from interface: IItem
Sets the Content-Type of this data.

Specified by:
setContentType in interface IItem
Parameters:
type - is this data's Content-Type

getContentEncoding

public java.lang.String getContentEncoding()
Description copied from interface: IItem
Indicates this data's Content-Encoding.

Specified by:
getContentEncoding in interface IItem
Returns:
String defines this data's Content-Encoding.

setContentEncoding

public void setContentEncoding(java.lang.String encoding)
Description copied from interface: IItem
Sets the Content-Encoding of this data.

Specified by:
setContentEncoding in interface IItem
Parameters:
encoding - indicates the data's encoding

getContentLength

public long getContentLength()
Description copied from interface: IItem
Indicates the length of the data.

Specified by:
getContentLength in interface IItem
Returns:
long indicates the length of the data

setContentLength

public void setContentLength(long length)
Description copied from interface: IItem
Sets the Content-Length of this data.

Specified by:
setContentLength in interface IItem
Parameters:
length - is the data's length

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object