public class ZipArchive extends Object
Archive.Entry
Constructor and Description |
---|
ZipArchive(File zipFile)
Creates a new archive that is based on the given zip file.
|
ZipArchive(File zipFile,
boolean isTempFile)
Creates a new archive that is based on the given zip file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
closes the archive
|
Archive.Entry |
getEntry(String path)
Returns the entry specified by path.
|
File |
getFile()
Returns the underlying file or
null if it does not exist. |
long |
getFileSize()
Returns the size of the underlying file or -1 if it does not exist.
|
VaultInputSource |
getInputSource(Archive.Entry entry)
Returns an input source for the given entry
|
Archive.Entry |
getJcrRoot()
Returns the entry that specifies the "jcr_root".
|
MetaInf |
getMetaInf()
Returns the meta inf.
|
Archive.Entry |
getRoot()
Returns the root entry.
|
Archive |
getSubArchive(String rootPath,
boolean asJcrRoot)
Returns a sub archive that is rooted at the given path.
|
void |
open(boolean strict)
Opens the archive.
|
InputStream |
openInputStream(Archive.Entry entry)
Opens an input stream for the given entry
|
String |
toString() |
public ZipArchive(@Nonnull File zipFile)
zipFile
- the zip filepublic void open(boolean strict) throws IOException
Archive
strict
- if true
open will fail if there was an
internal error while parsing meta data.IOException
- if an error occurs@Nullable public InputStream openInputStream(@Nullable Archive.Entry entry) throws IOException
Archive
entry
- the entrynull
if the entry can't be readIOException
- if an error occurs@Nullable public VaultInputSource getInputSource(@Nullable Archive.Entry entry) throws IOException
Archive
entry
- the entrynull
if the entry can't be readIOException
- if an error occurspublic void close()
Archive
@Nonnull public Archive.Entry getRoot() throws IOException
Archive
IOException
- if an error occurs@Nonnull public MetaInf getMetaInf()
Archive
@Nullable public File getFile()
null
if it does not exist.public long getFileSize()
public Archive.Entry getEntry(String path) throws IOException
Archive
getEntry
in interface Archive
path
- the pathnull
if not found.IOException
- if an error occurspublic Archive.Entry getJcrRoot() throws IOException
Archive
null
is returned.getJcrRoot
in interface Archive
null
IOException
- if an error occurspublic Archive getSubArchive(String rootPath, boolean asJcrRoot) throws IOException
Archive
getSubArchive
in interface Archive
rootPath
- root pathasJcrRoot
- if true
the given root is the jcr_rootnull
if entry specified by root
does not exist.IOException
- if an error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved