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,
CombineArchive archive,
boolean continueOnError,
List<String> errors)
|
static List<File> |
writeFile(File baseDir,
HashMap<String,ArchiveEntry> entries,
CombineArchive archive)
|
static List<File> |
writeFiles(File baseDir,
HashMap<String,ArchiveEntry> entries,
CombineArchive archive)
|
public static void readFile(Path file, HashMap<String,ArchiveEntry> entries, CombineArchive archive, boolean continueOnError, List<String> errors) throws ParseException, org.jdom2.JDOMException, IOException, CombineArchiveException
archive
and/or its entries
given in entries
.file
- the file containing meta dataentries
- the entries available in the corresponding archivearchive
- the archive which contains this filecontinueOnError
- ignore errors and continue (as far as possible)errors
- the list of occurred errorsParseException
- the parse exceptionorg.jdom2.JDOMException
- the jDOM exceptionIOException
- Signals that an I/O exception has occurred.CombineArchiveException
- the combine archive exceptionpublic 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, CombineArchive archive) throws IOException, TransformerException
archive
and its
entries
given in archive
and
entries
to a single 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
baseDir
- the base directory to store the filesentries
- the archive entriesarchive
- the archive which will contain the filesIOException
- Signals that an I/O exception has occurred.TransformerException
- the transformer exception
writeFile(File,HashMap,CombineArchive)
if you want to
store all meta data in a
single file.
public static List<File> writeFile(File baseDir, HashMap<String,ArchiveEntry> entries, CombineArchive archive) throws IOException, TransformerException
archive
and its
entries
given in archive
and
entries
to a single meta data file.
This method will create one meta data file for all description. 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,CombineArchive)
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 entriesarchive
- the archive which will contain the filesIOException
- Signals that an I/O exception has occurred.TransformerException
- the transformer exceptionCopyright © 2014. All rights reserved.