diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-07 21:33:05 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-07 21:33:05 +0000 |
commit | e07731fdb6f8adf3efa04eb38828e0da0302e417 (patch) | |
tree | 4fc6fb5d08af0c5b9517d44d9a6fd1ad92e7589e /libjava/java/util/jar | |
parent | 4964fd9c8f7f524c5bdd0b4fe8d81a555f74acb9 (diff) | |
download | gcc-e07731fdb6f8adf3efa04eb38828e0da0302e417.tar.gz |
* java/util/jar/JarFile.java (JarFile(String, boolean)): Read manifest
when verify is true.
(JarFile(File, boolean)): Likewise.
(manifestRead): Set manifestRead field correctly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62545 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/jar')
-rw-r--r-- | libjava/java/util/jar/JarFile.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/libjava/java/util/jar/JarFile.java b/libjava/java/util/jar/JarFile.java index d6fd9846b6e..394b51af6d0 100644 --- a/libjava/java/util/jar/JarFile.java +++ b/libjava/java/util/jar/JarFile.java @@ -1,5 +1,5 @@ /* JarFile.java - Representation of a jar file - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -71,10 +71,10 @@ public class JarFile extends ZipFile */ private Manifest manifest; - /** Wether to verify the manifest and all entries. */ + /** Whether to verify the manifest and all entries. */ private boolean verify; - /** Wether the has already been loaded. */ + /** Whether the has already been loaded. */ private boolean manifestRead = false; // Constructors @@ -109,6 +109,11 @@ public class JarFile extends ZipFile FileNotFoundException, IOException { super(fileName); + if (verify) + { + manifest = readManifest(); + verify(); + } } /** @@ -141,6 +146,11 @@ public class JarFile extends ZipFile IOException { super(file); + if (verify) + { + manifest = readManifest(); + verify(); + } } /** @@ -165,6 +175,11 @@ public class JarFile extends ZipFile FileNotFoundException, IOException, IllegalArgumentException { super(file, mode); + if (verify) + { + manifest = readManifest(); + verify(); + } } // Methods @@ -196,15 +211,18 @@ public class JarFile extends ZipFile if (manEntry != null) { InputStream in = super.getInputStream(manEntry); + manifestRead = true; return new Manifest(in); } else { + manifestRead = true; return null; } } catch (IOException ioe) { + manifestRead = true; return null; } } |