Class 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 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

        contentLength, createRelative, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isFile, isReadable, lastModified, readableChannel, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 class org.springframework.core.io.AbstractResource
      • exists

        public boolean exists()
        This implementation always returns true.
        Specified by:
        exists in interface org.springframework.core.io.Resource
        Overrides:
        exists in class org.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 class org.springframework.core.io.AbstractResource
      • isOpen

        public boolean isOpen()
        This implementation always returns true.
        Specified by:
        isOpen in interface org.springframework.core.io.Resource
        Overrides:
        isOpen in class org.springframework.core.io.AbstractResource