org.outerj.daisy.books.store.impl
Class UserBookInstance

java.lang.Object
  extended by org.outerj.daisy.books.store.impl.UserBookInstance
All Implemented Interfaces:
BookInstance

public class UserBookInstance
extends java.lang.Object
implements 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lock

public void lock()
Specified by:
lock in interface BookInstance

unlock

public void unlock()
Specified by:
unlock in interface BookInstance

getName

public java.lang.String getName()
Specified by:
getName in interface BookInstance

getResource

public java.io.InputStream getResource(java.lang.String path)
Description copied from interface: BookInstance
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!

Specified by:
getResource in interface BookInstance

getResourceProperties

public org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument getResourceProperties(java.lang.String path)
Description copied from interface: BookInstance
Returns null if not available.

Specified by:
getResourceProperties in interface BookInstance

storeResource

public void storeResource(java.lang.String path,
                          java.io.InputStream is)
Description copied from interface: BookInstance
Stores a resource under the given path.

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

Specified by:
storeResource in interface BookInstance

storeResourceProperties

public void storeResourceProperties(java.lang.String path,
                                    org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument resourcePropertiesDocument)
Specified by:
storeResourceProperties in interface BookInstance

getResourceOutputStream

public java.io.OutputStream getResourceOutputStream(java.lang.String path)
                                             throws java.io.IOException
Description copied from interface: BookInstance
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!

Specified by:
getResourceOutputStream in interface BookInstance
Throws:
java.io.IOException

rename

public boolean rename(java.lang.String path,
                      java.lang.String newName)
Specified by:
rename in interface BookInstance

exists

public boolean exists(java.lang.String path)
Specified by:
exists in interface BookInstance

getLastModified

public long getLastModified(java.lang.String path)
Specified by:
getLastModified in interface BookInstance

getContentLength

public long getContentLength(java.lang.String path)
Specified by:
getContentLength in interface BookInstance

getAcl

public BookAcl getAcl()
Specified by:
getAcl in interface BookInstance

setAcl

public void setAcl(BookAcl bookAcl)
Specified by:
setAcl in interface BookInstance

canManage

public boolean canManage()
Description copied from interface: BookInstance
Returns true if the user can perform management operations on this book instance.

Specified by:
canManage in interface BookInstance

getResourceURI

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

Specified by:
getResourceURI in interface BookInstance

getPublicationsInfo

public PublicationsInfo getPublicationsInfo()
Specified by:
getPublicationsInfo in interface BookInstance

addPublication

public void addPublication(PublicationInfo publicationInfo)
Specified by:
addPublication in interface BookInstance

setPublications

public void setPublications(PublicationsInfo publicationsInfo)
Specified by:
setPublications in interface BookInstance

getMetaData

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

Specified by:
getMetaData in interface BookInstance

setMetaData

public void setMetaData(BookInstanceMetaData metaData)
Specified by:
setMetaData in interface BookInstance

getDescendantPaths

public java.lang.String[] getDescendantPaths(java.lang.String path)
Specified by:
getDescendantPaths in interface BookInstance


Copyright © -2006 . All Rights Reserved.