public class ArchiveEntry extends MetaDataHolder
descriptions
Constructor and Description |
---|
ArchiveEntry(CombineArchive archive,
Path relativeName,
URI format)
Instantiates a new archive entry.
|
Modifier and Type | Method and Description |
---|---|
int |
addAllDescriptions(File metaDataFile)
Add all descriptions in
metaDataFile |
File |
extractFile(File target)
Extract this file to
target . |
CombineArchive |
getArchive()
Gets the archive that contains this entry.
|
String |
getEntityPath()
Gets the path to this entity.
|
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.
|
URI |
getFormat()
Gets the format as reported by the archive's manifest.
|
Path |
getPath()
Gets the path to this entry.
|
void |
setFormat(URI format)
Sets the format of this entry.
|
addDescription, addDescription, getDescriptions, removeDescription
public ArchiveEntry(CombineArchive archive, Path relativeName, URI format)
archive
- the corresponding CombineArchiverelativeName
- the relative path name within archive
format
- the format, see CombineFormatizerpublic File extractFile(File target) throws IOException
target
. If target
is a
directory we'll write to target/getFileName ()
.target
- the target to write this item to.target
)IOException
public CombineArchive getArchive()
@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 getEntityPath()
getFilePath()
for entities of
type ArchiveEntry
.getEntityPath
in class MetaDataHolder
public URI getFormat()
public void setFormat(URI format)
format
- the format of this entrypublic 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 © 2015. All rights reserved.