diff options
| author | Tom Tromey <tromey@redhat.com> | 2006-05-14 20:38:32 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2006-05-14 20:38:32 +0000 |
| commit | 192554e63278ffff52e9eb985e8f9fae33b9638e (patch) | |
| tree | cd9159103b5977c98435371714ac79a0a170e23d /gnu/java/net | |
| parent | 682bd33d1c4b61637d1d27781e601276cf27912c (diff) | |
| download | classpath-192554e63278ffff52e9eb985e8f9fae33b9638e.tar.gz | |
PR classpath/27514:
* gnu/java/net/IndexListParser.java (JAR_INDEX_FILE): Renamed. Now
constant.
(JAR_INDEX_VERSION_KEY): Likewise.
(IndexListParser): Updated.
(getVersionInfo): Likewise.
* tools/gnu/classpath/tools/jar/Indexer.java: New file.
* tools/gnu/classpath/tools/jar/Action.java (run): Now throws
OptionException.
* tools/gnu/classpath/tools/jar/Main.java (initializeParser): Handle
-i.
(ModeOption): New constructor.
(parsed): Updated. Use setArchiveFile.
(setArchiveFile): New method.
(run): Handle no-argument case.
(main): Emit --help message on option error.
* tools/gnu/classpath/tools/jar/Updater.java (inputJar): New field.
(createManifest): New method.
(run): Updated. Throws OptionException. Correctly copy zip entry.
* tools/gnu/classpath/tools/jar/Creator.java (createManifest): New
method.
(writeManifest): Removed.
(outputStream): Now a JarOutputStream.
(writeCommandLineEntries): Changed parameters. Updated callers.
(run): Throws OptionException.
* java/util/jar/JarOutputStream.java (putNextEntry): Typo fix.
* java/util/jar/Manifest.java (read): Typo fix.
Diffstat (limited to 'gnu/java/net')
| -rw-r--r-- | gnu/java/net/IndexListParser.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gnu/java/net/IndexListParser.java b/gnu/java/net/IndexListParser.java index 31a6dbbc8..cd4ca556b 100644 --- a/gnu/java/net/IndexListParser.java +++ b/gnu/java/net/IndexListParser.java @@ -63,8 +63,9 @@ import java.util.jar.JarFile; */ public class IndexListParser { - String filePath = "META-INF/INDEX.LIST"; - String versInfo = "JarIndex-Version: "; + public static final String JAR_INDEX_FILE = "META-INF/INDEX.LIST"; + public static final String JAR_INDEX_VERSION_KEY = "JarIndex-Version: "; + double versionNumber; ArrayList headers = new ArrayList(); @@ -80,16 +81,16 @@ public class IndexListParser try { // Parse INDEX.LIST if it exists - if (jarfile.getEntry(filePath) != null) + if (jarfile.getEntry(JAR_INDEX_FILE) != null) { BufferedReader br = new BufferedReader(new InputStreamReader(new URL(baseJarURL, - filePath).openStream())); + JAR_INDEX_FILE).openStream())); // Must start with version info String line = br.readLine(); - if (!line.startsWith(versInfo)) + if (!line.startsWith(JAR_INDEX_VERSION_KEY)) return; - versionNumber = Double.parseDouble(line.substring(versInfo.length()).trim()); + versionNumber = Double.parseDouble(line.substring(JAR_INDEX_VERSION_KEY.length()).trim()); // Blank line must be next line = br.readLine(); @@ -134,7 +135,7 @@ public class IndexListParser */ public String getVersionInfo() { - return versInfo + getVersionNumber(); + return JAR_INDEX_VERSION_KEY + getVersionNumber(); } /** |
