summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/net/protocol/jar/Connection.java
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-14 18:20:10 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-14 18:20:10 +0000
commit0e59a0d6f813468682be0fae5b44251a54624143 (patch)
tree8de981c27b99e5f3550c9d6ebf969b8edaec99fa /libjava/gnu/java/net/protocol/jar/Connection.java
parent28fbd488c4291a334e87d6e31485bea947fc628a (diff)
downloadppe42-gcc-0e59a0d6f813468682be0fae5b44251a54624143.tar.gz
ppe42-gcc-0e59a0d6f813468682be0fae5b44251a54624143.zip
2005-07-13 Andrew Haley <aph@redhat.com>
* gnu/java/net/protocol/file/Connection.java (unquote): New method. (connect): Unquote filename. gnu/java/net/protocol/jar/Connection.java (getInputStream): Likewise. (getJarFile): Likewise. * java/net/URLConnection.java (getContentHandler): Guard cast with instaceof. * java/net/URL.java (URL): If the file part of a spec is absolute, ignore the file part of its context. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/net/protocol/jar/Connection.java')
-rw-r--r--libjava/gnu/java/net/protocol/jar/Connection.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/libjava/gnu/java/net/protocol/jar/Connection.java b/libjava/gnu/java/net/protocol/jar/Connection.java
index 8ec35cce676..34df18354e8 100644
--- a/libjava/gnu/java/net/protocol/jar/Connection.java
+++ b/libjava/gnu/java/net/protocol/jar/Connection.java
@@ -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
{
OpenPOWER on IntegriCloud