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 Tue, 07 Nov 2006 15:38:52 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2047?page=comments#action_12447832 ] 
            
Oliver Deakin commented on HARMONY-2047:
----------------------------------------

Leo, Paulex - do you agree with the above analysis. Perhaps rewriting the FileURLConnection
constructor to:

public FileURLConnection(URL url) {
        super(url);
        fileName = url.getFile();
        if (url.getRef() != null) {
            fileName += "#" + url.getRef();
        }
        if (fileName == null) {
            fileName = "";
        }
        String host = url.getHost();
        if (host != null && host.length() > 0) {
            fileName = "//" + host + fileName;
        }
        fileName = Util.decode(fileName, false);
    }

is the right solution? Any comments?
With this modification the provided test passes, and all Harmony Junit tests pass.

> [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