-
Bug
-
Resolution: Won't Fix
-
P2
-
None
-
s8u6, solaris_8u1, 1.2.0, 1.2.1, 1.2.1_04, 1.2.2, 1.3.0, 1.3.1
-
generic, x86, sparc
-
generic, solaris_2.6, solaris_8, windows_98, windows_nt
characters when mapping a file path to a file: URL. For example, space
characters or '#' characters etc. should be escaped with a '%' followed by the
hexidecimal encoding of the character.
See RFC 2396 section 2.4.3.
Name: rlT66838 Date: 02/15/2000
java version "1.2.2"
HotSpot VM (1.0.1, mixed mode, build g)
1. Make directory, which name containts "!" sign and go to it.
2. Create java file like:
import java.net.*;
import java.io.*;
public class q
{
public q()
{
try {
URL u = getClass().getResource("myresources");
System.out.println("" + u);
InputStream in = u.openStream();
System.out.println("" + in);
InputStreamReader inr = new InputStreamReader(in);
} catch (Throwable t)
{
t.printStackTrace();
}
}
public static void main(String args[])
{
q qq = new q();
}
}
3. Create file named "myresources"
4. Place q.class and myresources to JAR file, by example "test.jar"
5. Run java -classpath test.jar q
6. Look at console:
jar:file:/M:/test/!/test.jar!/myresources
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:69)
at java.util.jar.JarFile.<init>(JarFile.java:71)
at java.util.jar.JarFile.<init>(JarFile.java:58)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:76)
at sun.net.www.protocol.jar.JarURLConnection.connect
(JarURLConnection.java:92)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream
(JarURLConnection.java:
112)
at java.net.URL.openStream(URL.java:818)
at q.<init>(q.java:10)
at q.main(q.java:21)
7. Place all files in, by example, "test" directory.
Run again. All is OK.
Problem occurs because "!" is Jar resource delimiter sign, and I think
that either "!" must not be resource delimiter sign, or
JarURLConnection::getResource() needed to be changed.
(Review ID: 101275)
======================================================================
###@###.### 10/15/04 18:46 GMT
- duplicates
-
JDK-4294586 NoClassDefFoundError if '#' anywhere in path
- Closed
-
JDK-4261416 '#' in path breaks the search algorith for classes
- Closed
-
JDK-4290786 JARs ending with # (e.g. ESlateCanvas#.jar) are ignored from the CLASSPATH
- Closed
-
JDK-4298764 Class can't put in directory include '#' charactor.
- Closed
-
JDK-4496398 MarshalledObject fails with objects loaded from file urls with spaces
- Closed
- relates to
-
JDK-6243843 Use of File.toURL in plugin - toURL known to return invalid URLs
- Closed
-
JDK-6243824 Use of File.toURL in com/sun/org/apache/xalan/internal/xsltc - toURL known to return invalid URLs
- Resolved
-
JDK-6243835 Use of File.toURL in plugin and webstart - toURL known to return invalid URLs
- Resolved
-
JDK-4359123 NoClassDefFoundError if '#' anywhere in path
- Closed
-
JDK-4416056 Application requesting JRE 1.4.0-beta could not be launched (B58)
- Closed
-
JDK-6179468 (spec) File.toURL should be @deprecated
- Closed
-
JDK-6243815 Use of File.toURL in com/sun/java/swing/plaf/gtk/Metacity.java - toURL known to return invalid URLs
- Closed
-
JDK-6243826 Use of File.toURL in com/sun/security/auth/PolicyFile.java - toURL known to return invalid URLs
- Closed
-
JDK-6243829 Use of File.toURL in sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java
- Closed
-
JDK-6243831 Use of File.toURL in sun/tools/jstat/Arguments.java - toURL known to return invalid URLs
- Closed
-
JDK-6243837 Use of File.toURL in javawebstart - toURL known to return invalid URLs
- Closed