--- /home/tromey/gnu/Nightly/classpath/classpath/java/net/JarURLConnection.java 2004-10-14 02:23:06.000000000 -0600 +++ java/net/JarURLConnection.java 2004-10-28 02:16:11.000000000 -0600 @@ -42,7 +42,9 @@ import java.util.jar.Attributes; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import java.util.jar.JarInputStream; import java.util.jar.Manifest; +import java.util.zip.ZipEntry; /** @@ -151,9 +153,46 @@ */ public JarEntry getJarEntry() throws IOException { - JarFile jarFile = getJarFile(); + JarFile jarfile = null; - return jarFile != null ? jarFile.getJarEntry(entryName) : null; + if (entryName == null) + return null; + + if (! doInput) + throw new ProtocolException("Can't open JarEntry if doInput is false"); + + try + { + jarfile = getJarFile (); + } + catch (IOException x) + { + /* ignore */ + } + + if (jarfile == null) + { + JarInputStream zis = new JarInputStream( + jarFileURLConnection.getInputStream ()); + + // This is hideous, we're doing a linear search for the thing... + for (ZipEntry ent = zis.getNextEntry (); + ent != null; + ent = zis.getNextEntry ()) + { + if (entryName.equals (ent.getName())) + { + return new JarEntry (ent); + } + } + } + + else + { + return jarfile.getJarEntry (entryName); + } + + return null; } /**