org.loom.persistence.file
Class PersistentFileResource

java.lang.Object
  extended by org.springframework.core.io.AbstractResource
      extended by org.loom.persistence.file.PersistentFileResource
All Implemented Interfaces:
org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource

public class PersistentFileResource
extends org.springframework.core.io.AbstractResource

Adapter from PersistentFile to Spring Resource API


Constructor Summary
PersistentFileResource(PersistentFile file)
           
 
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()
          This implementation returns the passed-in description, if any.
 java.io.InputStream getInputStream()
           
 int hashCode()
          This implementation returns the hash code of the underlying InputStream.
 boolean isOpen()
          This implementation always returns false.
 
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

PersistentFileResource

public PersistentFileResource(PersistentFile file)
Method Detail

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

isOpen

public boolean isOpen()
This implementation always returns false.

Specified by:
isOpen in interface org.springframework.core.io.Resource
Overrides:
isOpen in class org.springframework.core.io.AbstractResource

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          java.lang.IllegalStateException
Throws:
java.io.IOException
java.lang.IllegalStateException

getDescription

public java.lang.String getDescription()
This implementation returns the passed-in description, if any.


equals

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

Overrides:
equals in class org.springframework.core.io.AbstractResource

hashCode

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

Overrides:
hashCode in class org.springframework.core.io.AbstractResource