commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35422] New: - [io] FileUtils.toFile(URL) does not unescape %xx characters
Date Sun, 19 Jun 2005 22:52:37 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35422>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35422

           Summary: [io] FileUtils.toFile(URL) does not unescape %xx
                    characters
           Product: Commons
           Version: 1.0 Final
          Platform: All
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: IO
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: alexh.public@gmail.com


FileUtils.toFile(URL) does not properly handle URLs with %xx escaped characters,
which should be unescaped in the resulting File object (using
java.net.URLDecoder.decode(String) or similar).

The following JUnit tests expose the problem:

    public void testToFileHash() throws MalformedURLException
    {
        File expected = new File("ab#c").getAbsoluteFile();
        URL url = expected.toURI().toURL();

        File actual = FileUtils.toFile(url);
        
        assertEquals(expected, actual);
    }
    
    public void testToFileQuestionMark() throws MalformedURLException
    {
        File expected = new File("ab?c").getAbsoluteFile();
        URL url = expected.toURI().toURL();

        File actual = FileUtils.toFile(url);
        
        assertEquals(expected, actual);
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message