|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.fascinator.common.storage.StorageUtils
public class StorageUtils
Storage API utility methods.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_HOSTNAME
Default host name |
| Constructor Summary | |
|---|---|
StorageUtils()
|
|
| Method Summary | |
|---|---|
static DigitalObject |
checkHarvestFile(Storage storage,
java.io.File file)
Ensure the provided harvest file is up-to-date in storage. |
static Payload |
createLinkedPayload(DigitalObject object,
java.lang.String pid,
java.lang.String path)
Creates a linked Payload in the specified DigitalObject |
static Payload |
createOrUpdatePayload(DigitalObject object,
java.lang.String pid,
java.io.InputStream in)
Create or update a stored Payload in the specified DigitalObject |
static Payload |
createOrUpdatePayload(DigitalObject object,
java.lang.String pid,
java.io.InputStream in,
java.lang.String filePath)
|
static java.lang.String |
generateOid(java.io.File file)
Generates a Object identifier for a given file |
static java.lang.String |
generatePid(java.io.File file)
Generates a Payload identifier for a given file |
static DigitalObject |
getDigitalObject(Storage storage,
java.lang.String oid)
Gets a DigitalObject from the specified Storage instance. |
static DigitalObject |
linkFile(Storage storage,
java.io.File file)
This method stores a link to a File as a DigitalObject into the specified Storage |
static DigitalObject |
storeFile(Storage storage,
java.io.File file)
This method stores a copy of a File as a DigitalObject into the specified Storage |
static DigitalObject |
storeFile(Storage storage,
java.io.File file,
boolean linked)
This method stores a File as a DigitalObject into the specified Storage. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_HOSTNAME
| Constructor Detail |
|---|
public StorageUtils()
| Method Detail |
|---|
public static java.lang.String generateOid(java.io.File file)
file - the File to store
public static java.lang.String generatePid(java.io.File file)
file - the File to store
public static DigitalObject storeFile(Storage storage,
java.io.File file)
throws StorageException
storage - a Storage instancefile - the File to store
StorageException - if there was an error storing the file
public static DigitalObject linkFile(Storage storage,
java.io.File file)
throws StorageException
storage - a Storage instancefile - the File to store
StorageException - if there was an error storing the file
public static DigitalObject storeFile(Storage storage,
java.io.File file,
boolean linked)
throws StorageException
storage - a Storage instancefile - the File to storelinked - set true to link to the original file, false to copy
StorageException - if there was an error storing the file
public static DigitalObject getDigitalObject(Storage storage,
java.lang.String oid)
throws StorageException
storage - a Storage instanceoid - the object identifier to get (or create)
StorageException - if the object could not be retrieved or created
public static DigitalObject checkHarvestFile(Storage storage,
java.io.File file)
throws StorageException
storage - a Storage instancefile - to check in storage
StorageException - if the object could not be retrieved or created
public static Payload createOrUpdatePayload(DigitalObject object,
java.lang.String pid,
java.io.InputStream in)
throws StorageException
object - the DigitalObject to create the Payload inpid - the Payload IDin - the InputStream for the Payload's data
StorageException - if the Payload could not be created
public static Payload createOrUpdatePayload(DigitalObject object,
java.lang.String pid,
java.io.InputStream in,
java.lang.String filePath)
throws StorageException
StorageException
public static Payload createLinkedPayload(DigitalObject object,
java.lang.String pid,
java.lang.String path)
throws StorageException
object - the DigitalObject to create the Payload inpid - the Payload IDpath - the absolute path to the file the Payload links to
StorageException - if the Payload could not be created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||