|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.outerj.daisy.books.store.impl.CommonBookInstance
public class CommonBookInstance
A book instance. Instances of this object can be used by multiple users/thread, this
object is wrapped inside a UserBookInstance by the CommonBookStore
before returning it to a particular user.
| Constructor Summary | |
|---|---|
protected |
CommonBookInstance(java.io.File bookInstanceDirectory,
CommonBookStore owner)
|
| 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 |
| Constructor Detail |
|---|
protected CommonBookInstance(java.io.File bookInstanceDirectory,
CommonBookStore owner)
| Method Detail |
|---|
public java.lang.String getName()
getName in interface BookInstancepublic java.io.InputStream getResource(java.lang.String path)
BookInstanceThrows a BookResourceNotFoundException if the path does not exist.
It is the callers' responsibility to close this stream!
getResource in interface BookInstancepublic org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument getResourceProperties(java.lang.String path)
BookInstance
getResourceProperties in interface BookInstance
public void storeResourceProperties(java.lang.String path,
org.outerx.daisy.x10Bookstoremeta.ResourcePropertiesDocument resourcePropertiesDocument)
storeResourceProperties in interface BookInstance
public void storeResource(java.lang.String path,
java.io.InputStream is)
BookInstanceThe implementation of this method is required to close the input stream, even if an exception occurs.
storeResource in interface BookInstance
public java.io.OutputStream getResourceOutputStream(java.lang.String path)
throws java.io.IOException
BookInstanceThis 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!
getResourceOutputStream in interface BookInstancejava.io.IOException
public boolean rename(java.lang.String path,
java.lang.String newName)
rename in interface BookInstancepublic boolean exists(java.lang.String path)
exists in interface BookInstancepublic long getLastModified(java.lang.String path)
getLastModified in interface BookInstancepublic long getContentLength(java.lang.String path)
getContentLength in interface BookInstancepublic void lock()
lock in interface BookInstancepublic void unlock()
unlock in interface BookInstancepublic boolean canManage()
BookInstance
canManage in interface BookInstancepublic BookAcl getAcl()
getAcl in interface BookInstancepublic void setAcl(BookAcl bookAcl)
setAcl in interface BookInstancepublic PublicationsInfo getPublicationsInfo()
getPublicationsInfo in interface BookInstancepublic void addPublication(PublicationInfo publicationInfo)
addPublication in interface BookInstancepublic void setPublications(PublicationsInfo publicationsInfo)
setPublications in interface BookInstancepublic BookInstanceMetaData getMetaData()
BookInstance
getMetaData in interface BookInstancepublic void setMetaData(BookInstanceMetaData metaData)
setMetaData in interface BookInstancepublic java.net.URI getResourceURI(java.lang.String path)
BookInstance
getResourceURI in interface BookInstancepublic java.lang.String[] getDescendantPaths(java.lang.String path)
getDescendantPaths in interface BookInstance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||