public class StorageUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_HOSTNAME
Default host name
|
| Constructor and Description |
|---|
StorageUtils() |
| Modifier and Type | Method and Description |
|---|---|
static DigitalObject |
checkHarvestFile(Storage storage,
File file)
Ensure the provided harvest file is up-to-date in storage.
|
static Payload |
createLinkedPayload(DigitalObject object,
String pid,
String path)
Creates a linked Payload in the specified DigitalObject
|
static Payload |
createOrUpdatePayload(DigitalObject object,
String pid,
InputStream in)
Create or update a stored Payload in the specified DigitalObject
|
static Payload |
createOrUpdatePayload(DigitalObject object,
String pid,
InputStream in,
String filePath) |
static String |
generateOid(File file)
Generates a Object identifier for a given file
|
static String |
generatePid(File file)
Generates a Payload identifier for a given file
|
static DigitalObject |
getDigitalObject(Storage storage,
String oid)
Gets a DigitalObject from the specified Storage instance.
|
static DigitalObject |
linkFile(Storage storage,
File file)
This method stores a link to a File as a DigitalObject into the specified
Storage
|
static DigitalObject |
storeFile(Storage storage,
File file)
This method stores a copy of a File as a DigitalObject into the specified
Storage
|
static DigitalObject |
storeFile(Storage storage,
File file,
boolean linked)
This method stores a File as a DigitalObject into the specified Storage.
|
public static final String DEFAULT_HOSTNAME
public static String generateOid(File file)
file - the File to storepublic static String generatePid(File file)
file - the File to storepublic static DigitalObject storeFile(Storage storage, File file) throws StorageException
storage - a Storage instancefile - the File to storeStorageException - if there was an error storing the filepublic static DigitalObject linkFile(Storage storage, File file) throws StorageException
storage - a Storage instancefile - the File to storeStorageException - if there was an error storing the filepublic static DigitalObject storeFile(Storage storage, File file, boolean linked) throws StorageException
storage - a Storage instancefile - the File to storelinked - set true to link to the original file, false to copyStorageException - if there was an error storing the filepublic static DigitalObject getDigitalObject(Storage storage, String oid) throws StorageException
storage - a Storage instanceoid - the object identifier to get (or create)StorageException - if the object could not be retrieved or createdpublic static DigitalObject checkHarvestFile(Storage storage, File file) throws StorageException
storage - a Storage instancefile - to check in storageStorageException - if the object could not be retrieved or createdpublic static Payload createOrUpdatePayload(DigitalObject object, String pid, InputStream in) throws StorageException
object - the DigitalObject to create the Payload inpid - the Payload IDin - the InputStream for the Payload's dataStorageException - if the Payload could not be createdpublic static Payload createOrUpdatePayload(DigitalObject object, String pid, InputStream in, String filePath) throws StorageException
StorageExceptionpublic static Payload createLinkedPayload(DigitalObject object, String pid, String path) throws StorageException
object - the DigitalObject to create the Payload inpid - the Payload IDpath - the absolute path to the file the Payload links toStorageException - if the Payload could not be createdCopyright © 2009-2013. All Rights Reserved.