|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectokapi.util.OkapiStore
public class OkapiStore
General file-like storage.
Use an OkapiStore much as you'd use a file. Create a new Store with OkapiStore(originalFilename, mimeType, user) or OkapiStore(originalFilename, mimeType), and record the ID of this store for future use. Use OkapiStoreOutputStream or OkapiStoreWriter to write to the new store.
We record the originalFilename string as an aid to users in recognizing the file, it has no other function. E.g., when a Store is used in a Content, it is wrapped in an Atom which has a name associated with it which is independent of the original file name.
Create new versions of the Store by calling its newVersion() method and record the returned versionKey, or access the available versions of the Store through the vector returned by getVersions.
To read the contents of a Store, use OkapiStore(storeID) and then use OkapiStoreInputStream or OkapiStoreReader. To access a particular version, use the getVersion() method with the versionKey of the version you want to use. Otherwise you'll get the latest version.
Constructor Summary | |
---|---|
protected |
OkapiStore()
|
|
OkapiStore(java.lang.String id)
Return latest version of the OkapiStore with this ID. |
protected |
OkapiStore(java.lang.String id,
OkapiStoreFactory factory)
|
|
OkapiStore(java.lang.String filePath,
java.lang.String mimeType)
Create new Store, with original filePath, specified mime-type. |
|
OkapiStore(java.lang.String filePath,
java.lang.String mimeType,
java.lang.String userName)
Create new Store, with original filePath, specified mime-type, for specified user (by name). |
protected |
OkapiStore(java.lang.String filePath,
java.lang.String mimeType,
java.lang.String userName,
OkapiStoreFactory factory)
|
Method Summary | |
---|---|
protected void |
finalize()
|
java.lang.String |
getFilePath()
Return filePathof this OkapiStore. |
java.lang.String |
getID()
Return ID of this OkapiStore. |
java.util.jar.JarFile |
getJarFile()
return store as a jar file |
void |
getLatestVersion()
Set OkapiStore to latest version |
java.lang.String |
getMimeType()
Return mime-type of this OkapiStore. |
static java.util.Hashtable |
getStoredFilePaths()
Deprecated. |
boolean |
getVersion(java.lang.String versionKey)
Set OkapiStore to particular version, or return false. |
java.util.List |
getVersions()
Return Vector of available versions of this OkapiStore. |
long |
lastModified()
long lastModified() Returns the time that the file denoted by this abstract pathname was last modified. |
long |
length()
Returns the length of the Store |
java.lang.String |
newVersion(java.lang.String userName)
Create a new version of this OkapiStore. |
static void |
recoverState()
Recover stores list from metadata stored with each file. |
void |
setDataSource(javax.sql.DataSource dataSource)
Set the dataSource to be used for data access. |
static void |
setFilingParameters(java.lang.String newOkiStorePrefix,
java.lang.String serviceName,
java.lang.String clientFactoryName,
java.lang.String hostName,
int hostPort)
Method setFilingParameters |
void |
setMimeType(java.lang.String mimeType)
Return mime-type of this OkapiStore. |
static void |
setServerName(java.lang.String newServerName)
Set the name of the server, to be used in file:// URIs. |
void |
setStaticOkapiStoreFactory(OkapiStoreFactory newFactory)
|
static void |
setStoresDirectory(java.lang.String directory)
Set the directory to be used for the creation and retrieval of all future Stores. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OkapiStore(java.lang.String filePath, java.lang.String mimeType, java.lang.String userName)
OkapiStoreFactory
.
protected OkapiStore(java.lang.String filePath, java.lang.String mimeType, java.lang.String userName, OkapiStoreFactory factory)
public OkapiStore(java.lang.String filePath, java.lang.String mimeType)
OkapiStoreFactory
.
public OkapiStore(java.lang.String id)
OkapiStoreFactory
.
protected OkapiStore(java.lang.String id, OkapiStoreFactory factory)
protected OkapiStore()
Method Detail |
---|
public void setStaticOkapiStoreFactory(OkapiStoreFactory newFactory)
protected void finalize()
finalize
in class java.lang.Object
public static void setStoresDirectory(java.lang.String directory)
OkapiStoreFactory
.
public static void setServerName(java.lang.String newServerName)
OkapiStoreFactory
.
public static void setFilingParameters(java.lang.String newOkiStorePrefix, java.lang.String serviceName, java.lang.String clientFactoryName, java.lang.String hostName, int hostPort)
newOkiStorePrefix
- serviceName
- clientFactoryName
- hostName
- hostPort
- to be deprecated Use OkapiStoreFactory
.public boolean getVersion(java.lang.String versionKey)
public void getLatestVersion()
public java.lang.String getID()
public java.lang.String getFilePath()
public java.lang.String getMimeType()
public void setMimeType(java.lang.String mimeType)
public java.util.List getVersions()
public java.lang.String newVersion(java.lang.String userName)
public static java.util.Hashtable getStoredFilePaths()
public static void recoverState()
public long length()
public long lastModified()
public java.util.jar.JarFile getJarFile()
public void setDataSource(javax.sql.DataSource dataSource)
dataSource
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |