|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.okiproject.serviceapi.file.ByteStore
Copyright (c) 2001 Massachusetts Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The ByteStore is the key interface. It is a set of bytes with associated physical metadata.
If the Cabinet implementation supports it, each ByteStore may be stored redundantly on multiple servers for protection against data loss.
If the Cabinet implementation supports versioning, it may have several versions of arbitrary depth.
For ease of use, the ByteStore interface parallels when appropriate the java.io.File class.
Versioning may be supported in the Cabinet. The default is to return the latest version of a ByteStore. Other versions may be accessed by a key string. Each version is itself a ByteStore, and may have versions of its own, permitting branching. The underlying principle is that all versions should serve the same basic purpose, have the same mime-type, be functionally equivalent. If idiosyncrasies of a particular version are significant, that version key may be specified. When a version key is specified, the base version rather than any latest sub-version is returned. Sub versions may then be obtained if desired. Different versions will only differ in bytes of content and therefore length, lastModified time, and digest/checksum. A particular version may be given a GUID only by creating a new ByteStore in the Cabinet.
$Source: /cvs/oki/org/okiproject/serviceapi/doc/file/org/okiproject/serviceapi/file/ByteStore.html,v $
Constructor Summary | |
ByteStore()
|
Method Summary | |
boolean |
canRead()
Method canRead |
boolean |
canWrite()
Method canWrite |
int |
compareTo(java.lang.Object o)
Method compareTo |
void |
deleteOnExit()
Method deleteOnExit |
boolean |
equals(java.lang.Object obj)
Method equals |
java.util.jar.Attributes |
getAttributes()
Method getAttributes |
ByteStore |
getBaseVersion()
Method getBaseVersion |
java.lang.String |
getByteStoreName()
Method getByteStoreName |
java.lang.String |
getDigest(java.lang.String digestAlgorithm)
Method getDigest |
org.okiproject.serviceapi.guid.GUID |
getGUID()
Method getGUID |
java.io.InputStream |
getInputStream()
Method getInputStream |
ByteStore |
getLatestVersion()
Method getLatestVersion |
java.lang.String |
getMimeType()
Method getMimeType |
java.io.OutputStream |
getOutputStream()
Method getOutputStream |
org.okiproject.serviceapi.common.Agent |
getOwner()
Method getOwner |
java.io.Reader |
getReader()
Method getReader |
ByteStore |
getVersion(java.lang.String versionKey)
Method getVersion |
ByteStore[] |
getVersions()
Method getVersions |
java.io.Writer |
getWriter()
Method getWriter |
int |
hashCode()
Method hashCode |
boolean |
hasVersions()
Method hasVersions |
long |
lastModified()
Method lastModified |
long |
length()
Method length |
ByteStore |
newVersion(org.okiproject.serviceapi.common.Agent a,
java.lang.String versionKey)
Method newVersion |
boolean |
renameTo(java.lang.String newName)
Method renameTo |
boolean |
setLastModified(long time)
Method setLastModified |
void |
setMimeType(java.lang.String mimeType)
Method setMimeType |
void |
setOwner(org.okiproject.serviceapi.common.Agent owner)
Method setOwner |
boolean |
setReadOnly()
Method setReadOnly |
boolean |
setWritable()
Method setWritable |
java.lang.String |
toString()
Method toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ByteStore()
Method Detail |
public long length()
public long lastModified()
public boolean setLastModified(long time)
time
- public void deleteOnExit()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean canRead()
public boolean canWrite()
public boolean setReadOnly()
public boolean setWritable()
public int compareTo(java.lang.Object o)
o
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- public int hashCode()
hashCode
in class java.lang.Object
public org.okiproject.serviceapi.guid.GUID getGUID()
public java.lang.String getByteStoreName()
public boolean renameTo(java.lang.String newName)
newName
- public java.lang.String getMimeType()
public void setMimeType(java.lang.String mimeType)
mimeType
- public java.lang.String getDigest(java.lang.String digestAlgorithm)
digestAlgorithm
- public java.util.jar.Attributes getAttributes()
public org.okiproject.serviceapi.common.Agent getOwner()
public void setOwner(org.okiproject.serviceapi.common.Agent owner)
owner
- public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public java.io.Reader getReader()
public java.io.Writer getWriter()
public boolean hasVersions()
public ByteStore getLatestVersion()
public ByteStore getBaseVersion()
public ByteStore getVersion(java.lang.String versionKey)
versionKey
- public ByteStore[] getVersions()
public ByteStore newVersion(org.okiproject.serviceapi.common.Agent a, java.lang.String versionKey)
a
- versionKey
-
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |