|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.planets_project.services.utils.DigitalObjectUtils
public final class DigitalObjectUtils
Utils for handling digital objects.
Method Summary | |
---|---|
static DigitalObject |
addEvent(DigitalObject digitalObject,
Event newEvent)
|
static boolean |
cleanDigObUtilsTmp()
|
static DigitalObject |
createZipTypeDigitalObject(File zip_Or_Folder,
String destZipName,
boolean createByReference,
boolean withChecksum,
boolean compress)
Creates a Zip-type DigitalObject either from a given folder or from a zip file. |
static long |
getContentSize(DigitalObject dob)
|
static List<File> |
getDigitalObjectsAsFiles(List<DigitalObject> listOfDigObjs,
File targetFolder)
A utility method that creates files for the content of "contained"-DigObs in a DigOb. |
static Event |
getEventBySummary(DigitalObject initObj,
String summary)
This method returns event by summary in the targetObj |
static String |
getFileNameFromDigObject(DigitalObject digOb,
URI supposedFormatURI)
Gets the title from the passed digOb and returns a proper file name |
static String |
getFolderNameFromDigObject(DigitalObject digOb)
Gets the title from the passed digOb and returns a proper folder name (e.g. |
static DigitalObject |
getFragment(DigitalObject digOb,
String fragment,
boolean createByReference)
This method returns a new DigOb, containing a file that is specified by the fragment. |
static boolean |
hasEvent(DigitalObject obj,
String summary)
This method evaluates if particular digital object contains an ingest event |
static DigitalObject |
insertFragment(DigitalObject zipTypeDigOb,
File fragmentFile,
String targetPathInZip,
boolean createByReference)
|
static boolean |
isZipType(DigitalObject digOb)
test if this is a zip type DigitalObject (format-URL == planets:fmt/ext/zip) |
static List<String> |
listFragments(DigitalObject digOb)
|
static void |
main(String[] args)
These cases: - A compound DO, zip as Content, with MD outside the zip, pointing into it via Title. |
static DigitalObject |
removeFragment(DigitalObject zipTypeDigOb,
String targetPathInZip,
boolean createByReference)
|
static File |
toFile(DigitalObject object)
|
static long |
toFile(DigitalObject object,
File file)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static long getContentSize(DigitalObject dob)
public static File toFile(DigitalObject object)
object
- The digital object to copy to a temporary file
public static long toFile(DigitalObject object, File file)
object
- The digital object to copy to a filefile
- The file to copy the digital object's byte stream to
public static void main(String[] args)
public static List<File> getDigitalObjectsAsFiles(List<DigitalObject> listOfDigObjs, File targetFolder)
listOfDigObjs
- The digital objects to create files fromtargetFolder
- The folder to store result files in
public static DigitalObject createZipTypeDigitalObject(File zip_Or_Folder, String destZipName, boolean createByReference, boolean withChecksum, boolean compress)
zip_Or_Folder
- destZipName
- the name of the created zip filecreateByReference
- Create the Content of the DO by reference or by valuewithChecksum
- Create a checksum for the zip file to createcompress
- compress the content of the zip file
public static DigitalObject getFragment(DigitalObject digOb, String fragment, boolean createByReference)
digOb
- the zip type DigOb to get the fragment fromfragment
- the fragment (file in the zip) to retrievecreateByReference
- create by reference (true) or as stream (false)
public static DigitalObject insertFragment(DigitalObject zipTypeDigOb, File fragmentFile, String targetPathInZip, boolean createByReference)
public static DigitalObject removeFragment(DigitalObject zipTypeDigOb, String targetPathInZip, boolean createByReference)
public static List<String> listFragments(DigitalObject digOb)
public static boolean isZipType(DigitalObject digOb)
digOb
- the DigitalObject to test
public static String getFolderNameFromDigObject(DigitalObject digOb)
digOb
- to get the folder name from
public static String getFileNameFromDigObject(DigitalObject digOb, URI supposedFormatURI)
digOb
- to get the file name fromsupposedFormatURI
- This could be the format you believe the file has. Used to create a proper file name.
public static boolean cleanDigObUtilsTmp()
public static DigitalObject addEvent(DigitalObject digitalObject, Event newEvent)
digitalObject
- The digital object to be updatednewEvent
- The event to add to the digital object
public static Event getEventBySummary(DigitalObject initObj, String summary)
initObj
- The initial digital objectsummary
- Event property we are looking for
public static boolean hasEvent(DigitalObject obj, String summary)
obj
- The digital objectsummary
- The summary of the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |