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.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
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 boolean
equals(java.lang.Object obj)
This implementation compares the underlying InputStream.boolean
exists()
This implementation always returnstrue
.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 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:
equals
in classorg.springframework.core.io.AbstractResource
-
exists
public boolean exists()
This implementation always returnstrue
.- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
- Overrides:
exists
in 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.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 classorg.springframework.core.io.AbstractResource
-
isOpen
public boolean isOpen()
This implementation always returnstrue
.- Specified by:
isOpen
in interfaceorg.springframework.core.io.Resource
- Overrides:
isOpen
in classorg.springframework.core.io.AbstractResource
-
-