harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Regis Xu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6106) [classlib][security] PolicyUtils.expandURL may return invalid URL on linux
Date Mon, 02 Mar 2009 07:12:12 GMT
[classlib][security] PolicyUtils.expandURL may return invalid URL on linux
--------------------------------------------------------------------------

                 Key: HARMONY-6106
                 URL: https://issues.apache.org/jira/browse/HARMONY-6106
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Regis Xu
             Fix For: 5.0M9


the test:
        Properties props = new Properties();
        props.put("my.home", "/home/bahamut");
        String location = PolicyUtils.expandURL("file:/${my.home}/test", props);
        URL url = new URL(location);
        System.out.println(url.getHost());
        System.out.println(url.getPath());
        System.out.println(url.toString());

output is:
home
/bahamut/test
file://home/bahamut/test

the expanded URL is "file://home/bahamut/test", but what we want is "file:/home/bahamut/test",

the one extra "/" make host of URL to be "home" which should be "", and then url.openConnection(),

the wrong URL will use ftp protocol to open the file.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message