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 |
---|---|
void |
addDescription(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.
|
org.json.simple.JSONObject |
toJsonObject()
Export a JSON description of this entry.
|
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 void addDescription(MetaDataObject description)
description
- the new descriptionpublic org.json.simple.JSONObject toJsonObject()
Copyright © 2014. All rights reserved.