OSDN Git Service

2005-07-13 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / libjava / gnu / java / net / protocol / jar / Connection.java
index 8ec35cc..34df183 100644 (file)
@@ -151,7 +151,8 @@ public final class Connection extends JarURLConnection
     if (jarfile != null)
       {
        // this is the easy way...
-       ZipEntry entry = jarfile.getEntry(getEntryName());
+       ZipEntry entry = jarfile.getEntry
+         (gnu.java.net.protocol.file.Connection.unquote(getEntryName()));
         
        if (entry != null)
          return jarfile.getInputStream (entry);
@@ -164,12 +165,14 @@ public final class Connection extends JarURLConnection
        JarInputStream zis = new JarInputStream(
                        jarFileURLConnection.getInputStream ());
 
+       String entryName = gnu.java.net.protocol.file.Connection.unquote(getEntryName());
+
        // This is hideous, we're doing a linear search...
        for (ZipEntry entry = zis.getNextEntry(); 
             entry != null; 
             entry = zis.getNextEntry())
          {
-           if (getEntryName().equals(entry.getName()))
+           if (entryName.equals(entry.getName()))
              {
                int size = (int) entry.getSize();
                byte[] data = new byte[size];
@@ -203,12 +206,14 @@ public final class Connection extends JarURLConnection
            jar_file = (JarFile) file_cache.get (jarFileURL);
            if (jar_file == null)
              {
-               jar_file = new JarFile (jarFileURL.getFile());
+               jar_file = new JarFile 
+                 (gnu.java.net.protocol.file.Connection.unquote(jarFileURL.getFile()));
                file_cache.put (jarFileURL, jar_file);
              }
          }
        else
-         jar_file = new JarFile (jarFileURL.getFile());
+         jar_file = new JarFile 
+           (gnu.java.net.protocol.file.Connection.unquote(jarFileURL.getFile()));
       }
     else
       {