harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Deakin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2047) [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special char in its name
Date Fri, 03 Nov 2006 15:24:17 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2047?page=comments#action_12446987 ] 
            
Oliver Deakin commented on HARMONY-2047:
----------------------------------------

Actually, the splitting of the URL by # is correct, as the following will demonstrate:

URL url =  new URL("file", "", -1, "/c:/path/to/file/AAA#.properties", null);
System.out.println(url.getPath());
System.out.println(url.getFile());
System.out.println(url.getRef());

The same results are produced on the RI and Harmony. The URL constructor parameters are identical
to those used in the test case when targetURL() creates the URL to the file. So the reason
the file is not found is because we end up looking for c:/path/to/file/AAA instead of c:/path/to/file/AAA#.properties.

> [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special
char in its name
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2047
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2047
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>
> ClassLoader.getResourceAsStream() fails to get property file with special char in its
name.
> Here is the testcase:
> (First pls put a property file called "AAA#.properties" in where can be searched by classpath.)
> public void testGetResourceAsStream() throws Exception
> {
>         InputStream in = TestClassLoader.class.getClassLoader().getResourceAsStream("AAA#.properties");
>         assertNotNull(in);
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message