org.restlet.ext.spring
Class SpringResource

java.lang.Object
  extended by org.springframework.core.io.AbstractResource
      extended by org.restlet.ext.spring.SpringResource
All Implemented Interfaces:
InputStreamSource, Resource

public class SpringResource
extends AbstractResource

Spring Resource based on a Restlet Representation. DON'T GET CONFUSED, Spring's notion of Resource is different from Restlet's one, actually it's closer to Restlet's Representations.

Author:
Jerome Louvel
See Also:
Spring home page

Constructor Summary
SpringResource(Representation representation)
          Constructor.
SpringResource(Representation representation, java.lang.String description)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          This implementation compares the underlying InputStream.
 boolean exists()
          This implementation always returns true.
 java.lang.String getDescription()
          Returns the description.
 java.io.InputStream getInputStream()
          This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.
 int hashCode()
          This implementation returns the hash code of the underlying InputStream.
 boolean isOpen()
          This implementation always returns true.
 
Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isReadable, lastModified, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpringResource

public SpringResource(Representation representation)
Constructor.

Parameters:
representation - The description.

SpringResource

public SpringResource(Representation representation,
                      java.lang.String description)
Constructor.

Parameters:
representation - The description.
description - The description.
Method Detail

equals

public boolean equals(java.lang.Object obj)
This implementation compares the underlying InputStream.

Overrides:
equals in class AbstractResource

exists

public boolean exists()
This implementation always returns true.

Specified by:
exists in interface Resource
Overrides:
exists in class AbstractResource

getDescription

public java.lang.String getDescription()
Returns the description.

Returns:
The description.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          java.lang.IllegalStateException
This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.

Throws:
java.io.IOException
java.lang.IllegalStateException

hashCode

public int hashCode()
This implementation returns the hash code of the underlying InputStream.

Overrides:
hashCode in class AbstractResource

isOpen

public boolean isOpen()
This implementation always returns true.

Specified by:
isOpen in interface Resource
Overrides:
isOpen in class AbstractResource


Copyright © 2005-2008 Noelios Technologies.