Methods Summary |
---|
protected java.util.zip.ZipEntry | createZipEntry(java.lang.String name)
JarEntry entry = new JarEntry(name);
if (manifest != null) {
entry.setAttributes(manifest.getAttributes(name));
}
return entry;
|
public java.util.jar.Manifest | getManifest()Returns the {@code Manifest} object associated with this {@code
JarInputStream} or {@code null} if no manifest entry exists.
return manifest;
|
public java.util.zip.ZipEntry | getNextEntry()Returns the next {@code ZipEntry} contained in this stream or {@code
null} if no more entries are present.
if (mEntry != null) {
jarEntry = mEntry;
mEntry = null;
jarEntry.setAttributes(null);
} else {
jarEntry = (JarEntry) super.getNextEntry();
if (jarEntry == null) {
return null;
}
if (verifier != null) {
isMeta = Util.toASCIIUpperCase(jarEntry.getName()).startsWith(
JarFile.META_DIR);
if (isMeta) {
verStream = new ByteArrayOutputStream();
} else {
verStream = verifier.initEntry(jarEntry.getName());
}
}
}
eos = false;
return jarEntry;
|
public java.util.jar.JarEntry | getNextJarEntry()Returns the next {@code JarEntry} contained in this stream or {@code
null} if no more entries are present.
return (JarEntry) getNextEntry();
|
public int | read(byte[] buffer, int offset, int length)Reads up to {@code length} of decompressed data and stores it in
{@code buffer} starting at {@code offset}.
if (mEntry != null) {
return -1;
}
int r = super.read(buffer, offset, length);
if (verStream != null && !eos) {
if (r == -1) {
eos = true;
if (verifier != null) {
if (isMeta) {
verifier.addMetaEntry(jarEntry.getName(),
((ByteArrayOutputStream) verStream)
.toByteArray());
try {
verifier.readCertificates();
} catch (SecurityException e) {
verifier = null;
throw e;
}
} else {
verifier.verifySignatures(
(JarVerifier.VerifierEntry) verStream,
jarEntry);
}
}
} else {
verStream.write(buffer, offset, r);
}
}
return r;
|