org.outerj.daisy.books.store
Interface BookInstance

All Known Implementing Classes:
CommonBookInstance, UserBookInstance

public interface BookInstance


Method Summary
 void addPublication(PublicationInfo publicationInfo)
           
 boolean canManage()
          Returns true if the user can perform management operations on this book instance.
 boolean exists(java.lang.String path)
           
 BookAcl getAcl()
           
 long getContentLength(java.lang.String path)
           
 java.lang.String[] getDescendantPaths(java.lang.String path)
           
 long getLastModified(java.lang.String path)
           
 BookInstanceMetaData getMetaData()
          Note: while this returns a mutable object, it is a clone of the original and any changed performed on it will not have effect.
 java.lang.String getName()
           
 PublicationsInfo getPublicationsInfo()
           
 java.io.InputStream getResource(java.lang.String path)
          Returns a stream for the given resource.
 java.io.OutputStream getResourceOutputStream(java.lang.String path)
          Get an output stream to store a resource in the book instance.
 org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument getResourceProperties(java.lang.String path)
          Returns null if not available.
 java.net.URI getResourceURI(java.lang.String path)
          Returns a Java URI that can be used to retrieve the resource.
 void lock()
           
 boolean rename(java.lang.String path, java.lang.String newName)
           
 void setAcl(BookAcl bookAcl)
           
 void setMetaData(BookInstanceMetaData metaData)
           
 void setPublications(PublicationsInfo publicationsInfo)
           
 void storeResource(java.lang.String path, java.io.InputStream is)
          Stores a resource under the given path.
 void storeResourceProperties(java.lang.String path, org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument resourcePropertiesDocument)
           
 void unlock()
           
 

Method Detail

getName

java.lang.String getName()

getResource

java.io.InputStream getResource(java.lang.String path)
Returns a stream for the given resource. The stream will already be buffered if needed.

Throws a BookResourceNotFoundException if the path does not exist.

It is the callers' responsibility to close this stream!


getResourceProperties

org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument getResourceProperties(java.lang.String path)
Returns null if not available.


storeResource

void storeResource(java.lang.String path,
                   java.io.InputStream is)
Stores a resource under the given path.

The implementation of this method is required to close the input stream, even if an exception occurs.


storeResourceProperties

void storeResourceProperties(java.lang.String path,
                             org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument resourcePropertiesDocument)

getResourceOutputStream

java.io.OutputStream getResourceOutputStream(java.lang.String path)
                                             throws java.io.IOException
Get an output stream to store a resource in the book instance.

This will return a buffered stream if necessary, no need to wrap it into a BufferedOutputStream yourself.

It is the callers' responsibility to close this stream!

Throws:
java.io.IOException

rename

boolean rename(java.lang.String path,
               java.lang.String newName)

exists

boolean exists(java.lang.String path)

getLastModified

long getLastModified(java.lang.String path)

getContentLength

long getContentLength(java.lang.String path)

lock

void lock()

unlock

void unlock()

getAcl

BookAcl getAcl()

setAcl

void setAcl(BookAcl bookAcl)

canManage

boolean canManage()
Returns true if the user can perform management operations on this book instance.


getPublicationsInfo

PublicationsInfo getPublicationsInfo()

addPublication

void addPublication(PublicationInfo publicationInfo)

setPublications

void setPublications(PublicationsInfo publicationsInfo)

getResourceURI

java.net.URI getResourceURI(java.lang.String path)
Returns a Java URI that can be used to retrieve the resource. Bypasses the BookInstance abstraction.


getMetaData

BookInstanceMetaData getMetaData()
Note: while this returns a mutable object, it is a clone of the original and any changed performed on it will not have effect.


setMetaData

void setMetaData(BookInstanceMetaData metaData)

getDescendantPaths

java.lang.String[] getDescendantPaths(java.lang.String path)


Copyright © -2006 . All Rights Reserved.