public class ArchiveEntry extends Object
Constructor and Description |
---|
ArchiveEntry(CombineArchive archive,
Path relativeName,
String format)
Instantiates a new archive entry.
|
Modifier and Type | Method and Description |
---|---|
int |
addAllDescriptions(File metaDataFile)
Add all descriptions in
metaDataFile |
void |
addDescription(MetaDataObject description)
Adds another meta object describing this entry.
|
void |
addDescription(String fragmentIdentifier,
MetaDataObject description)
Adds another meta object describing this entry.
|
File |
extractFile(File target)
Extract this file to
target . |
List<MetaDataObject> |
getDescriptions()
Gets the
MetaDataObjects describing this entry. |
File |
getFile()
Deprecated.
as of version 0.6, replaced by
(File target) |
String |
getFileName()
Gets the file name (w/o path) of this entry in the archive.
|
String |
getFilePath()
Gets the relative path name of this file in the archive.
|
String |
getFormat()
Gets the format as reported by the archive's manifest.
|
Path |
getPath()
Gets the path to this entry.
|
boolean |
removeDescription(MetaDataObject toDelete)
Removes a certain description.
|
public ArchiveEntry(CombineArchive archive, Path relativeName, String format)
archive
- the corresponding CombineArchiverelativeName
- the relative path name within archive
format
- the formatpublic File extractFile(File target) throws IOException
target
.target
- the target to write this item to.target
)IOException
@Deprecated public File getFile() throws IOException
(File target)
IOException
public Path getPath()
Be aware that this path points to the entry as it is zipped in the archive. Thus, some operations might fail or result in unexpected behaviour.
public String getFileName()
public String getFilePath()
The path will usually start with '/
', but do not rely on that.
Depending on the archive it might also start with './
' or
without anything.
public String getFormat()
public List<MetaDataObject> getDescriptions()
MetaDataObjects
describing this entry.
The returned list can contain any number of MetaDataObjects
, but might as well be empty.
public boolean removeDescription(MetaDataObject toDelete)
toDelete
- the meta data object to deletepublic void addDescription(String fragmentIdentifier, MetaDataObject description)
fragmentIdentifier
- the fragment identifier pointing into this entrydescription
- the new descriptionpublic void addDescription(MetaDataObject description)
description
- the new descriptionpublic int addAllDescriptions(File metaDataFile) throws org.jdom2.JDOMException, IOException
metaDataFile (assuming all are about this entry).
metaDataFile
- the file containing the meta dataIOException
org.jdom2.JDOMException
Copyright © 2014. All rights reserved.