public class MetaDataFile extends Object
Constructor and Description |
---|
MetaDataFile() |
Modifier and Type | Method and Description |
---|---|
static int |
addAllMetaToEntry(Path file,
ArchiveEntry entry)
Adds all descriptions of a file to a single entry.
|
static void |
readFile(Path file,
HashMap<String,ArchiveEntry> entries)
Read a meta data file containing descriptions about
ArchiveEntries given in entries . |
static List<File> |
writeFile(File baseDir,
HashMap<String,ArchiveEntry> entries)
Write the meta data about
ArchiveEntries given in
entries to a single meta data file. |
static List<File> |
writeFiles(File baseDir,
HashMap<String,ArchiveEntry> entries)
Write the meta data about
ArchiveEntries given in
entries to meta data files. |
public static void readFile(Path file, HashMap<String,ArchiveEntry> entries) throws ParseException, org.jdom2.JDOMException, IOException, CombineArchiveException
ArchiveEntries
given in entries
.file
- the file containing meta dataentries
- the entries available in the corresponding archiveParseException
- the parse exceptionorg.jdom2.JDOMException
- the jDOM exceptionIOException
- Signals that an I/O exception has occurred.CombineArchiveException
public static int addAllMetaToEntry(Path file, ArchiveEntry entry) throws org.jdom2.JDOMException, IOException
file
- the file containing the meta dataentry
- the entry in the archiveentry
org.jdom2.JDOMException
- the jDOM exceptionIOException
- Signals that an I/O exception has occurred.public static List<File> writeFiles(File baseDir, HashMap<String,ArchiveEntry> entries) throws IOException, TransformerException
ArchiveEntries
given in
entries
to meta data files.
This method will create one meta data file per entry. Meta data files will
be named baseDir/metadata(-[-0-9a-f]+)?.rdf
. See
writeFile(File,HashMap)
if you want to store all meta data in a
single file.
baseDir
- the base directory to store the filesentries
- the archive entriesIOException
- Signals that an I/O exception has occurred.TransformerException
- the transformer exceptionpublic static List<File> writeFile(File baseDir, HashMap<String,ArchiveEntry> entries) throws IOException, TransformerException
ArchiveEntries
given in
entries
to a single meta data file.
This method will create one meta data file for all entries. Thus, the
returned list of files will be of size one. The meta data file will be
named baseDir/metadata(-[-0-9a-f]+)?.rdf
. See
writeFiles(File,HashMap)
if you want to store the meta data in a
multiple files, one for each entry.
baseDir
- the base directory to store the fileentries
- the archive entriesIOException
- Signals that an I/O exception has occurred.TransformerException
- the transformer exceptionCopyright © 2014. All rights reserved.