Package org.restlet.ext.spring
Class SpringResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.restlet.ext.spring.SpringResource
-
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class SpringResource extends org.springframework.core.io.AbstractResourceSpring 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
Constructors Constructor Description SpringResource(org.restlet.representation.Representation representation)Constructor.SpringResource(org.restlet.representation.Representation representation, java.lang.String description)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)This implementation compares the underlying InputStream.booleanexists()This implementation always returnstrue.java.lang.StringgetDescription()Returns the description.java.io.InputStreamgetInputStream()This implementation throws IllegalStateException if attempting to read the underlying stream multiple times.inthashCode()This implementation returns the hash code of the underlying InputStream.booleanisOpen()This implementation always returnstrue.
-
-
-
Constructor Detail
-
SpringResource
public SpringResource(org.restlet.representation.Representation representation)
Constructor.- Parameters:
representation- The description.
-
SpringResource
public SpringResource(org.restlet.representation.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:
equalsin classorg.springframework.core.io.AbstractResource
-
exists
public boolean exists()
This implementation always returnstrue.- Specified by:
existsin interfaceorg.springframework.core.io.Resource- Overrides:
existsin classorg.springframework.core.io.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.IllegalStateExceptionThis implementation throws IllegalStateException if attempting to read the underlying stream multiple times.- Throws:
java.io.IOExceptionjava.lang.IllegalStateException
-
hashCode
public int hashCode()
This implementation returns the hash code of the underlying InputStream.- Overrides:
hashCodein classorg.springframework.core.io.AbstractResource
-
isOpen
public boolean isOpen()
This implementation always returnstrue.- Specified by:
isOpenin interfaceorg.springframework.core.io.Resource- Overrides:
isOpenin classorg.springframework.core.io.AbstractResource
-
-