org.springframework.extensions.surf.resource
Class ResourceContentImpl

java.lang.Object
  extended by org.springframework.extensions.surf.resource.ResourceContentImpl
All Implemented Interfaces:
ResourceContent
Direct Known Subclasses:
ResourceJSONContentImpl, ResourceXMLContentImpl

public class ResourceContentImpl
extends Object
implements ResourceContent

Binary resource content implementation

Author:
muzquiano

Field Summary
protected  byte[] bytes
           
protected  String id
           
static org.apache.commons.logging.Log logger
           
protected  Resource resource
           
protected  long timestamp
           
protected  String url
           
 
Constructor Summary
ResourceContentImpl(Resource resource, String url)
           
 
Method Summary
 byte[] getBytes()
          Gets the bytes.
 InputStream getInputStream()
          Retrieves an input stream to the resource content
 Reader getReader()
          Gets the reader for the resource content
 Resource getResource()
          A link back to the resource of which this content is a part
 long getTimestamp()
          Returns the timestamp when this content convenience instance was created
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static org.apache.commons.logging.Log logger

id

protected String id

resource

protected Resource resource

timestamp

protected long timestamp

url

protected String url

bytes

protected byte[] bytes
Constructor Detail

ResourceContentImpl

public ResourceContentImpl(Resource resource,
                           String url)
Method Detail

getResource

public Resource getResource()
Description copied from interface: ResourceContent
A link back to the resource of which this content is a part

Specified by:
getResource in interface ResourceContent
Returns:

getTimestamp

public long getTimestamp()
Description copied from interface: ResourceContent
Returns the timestamp when this content convenience instance was created

Specified by:
getTimestamp in interface ResourceContent
Returns:

getBytes

public byte[] getBytes()
                throws IOException
Description copied from interface: ResourceContent
Gets the bytes.

Specified by:
getBytes in interface ResourceContent
Returns:
the bytes
Throws:
IOException

getReader

public Reader getReader()
                 throws IOException
Description copied from interface: ResourceContent
Gets the reader for the resource content

Specified by:
getReader in interface ResourceContent
Returns:
the reader
Throws:
IOException - Signals that an I/O exception has occurred.

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: ResourceContent
Retrieves an input stream to the resource content

Specified by:
getInputStream in interface ResourceContent
Returns:
the input stream
Throws:
IOException - Signals that an I/O exception has occurred.


Copyright © 2009 SpringSource, Inc. All Rights Reserved.