public class ZipArchive
extends java.lang.Object
Archive.Entry| Constructor and Description |
|---|
ZipArchive(java.io.File zipFile)
Creates a new archive that is based on the given zip file.
|
ZipArchive(java.io.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(java.lang.String path)
Returns the entry specified by path.
|
java.io.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(java.lang.String rootPath,
boolean asJcrRoot)
Returns a sub archive that is rooted at the given path.
|
void |
open(boolean strict)
Opens the archive.
|
java.io.InputStream |
openInputStream(Archive.Entry entry)
Opens an input stream for the given entry
|
java.lang.String |
toString() |
public ZipArchive(java.io.File zipFile)
zipFile - the zip filepublic ZipArchive(java.io.File zipFile,
boolean isTempFile)
zipFile - the zip fileisTempFile - if true if the file is considered temporary and can be deleted after this archive is closed.public void open(boolean strict)
throws java.io.IOException
Archivestrict - if true open will fail if there was an
internal error while parsing meta data.java.io.IOException - if an error occurspublic java.io.InputStream openInputStream(Archive.Entry entry) throws java.io.IOException
Archiveentry - the entrynull if the entry can't be readjava.io.IOException - if an error occurspublic VaultInputSource getInputSource(Archive.Entry entry) throws java.io.IOException
Archiveentry - the entrynull if the entry can't be readjava.io.IOException - if an error occurspublic void close()
Archivepublic Archive.Entry getRoot() throws java.io.IOException
Archivejava.io.IOException - if an error occurspublic MetaInf getMetaInf()
Archivepublic java.io.File getFile()
null if it does not exist.public long getFileSize()
public java.lang.String toString()
toString in class java.lang.Objectpublic Archive.Entry getEntry(java.lang.String path) throws java.io.IOException
Archivepublic Archive.Entry getJcrRoot() throws java.io.IOException
Archivenull is returned.getJcrRoot in interface Archivenulljava.io.IOException - if an error occurspublic Archive getSubArchive(java.lang.String rootPath, boolean asJcrRoot) throws java.io.IOException
ArchivegetSubArchive in interface ArchiverootPath - root pathasJcrRoot - if true the given root is the jcr_rootnull if entry specified by root
does not exist.java.io.IOException - if an error occurs"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"