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 31884] New: - FileUtils.toFile() drops drive letter on windows
Date Mon, 25 Oct 2004 19:11:48 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=31884>.
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=31884

FileUtils.toFile() drops drive letter on windows

           Summary: FileUtils.toFile() drops drive letter on windows
           Product: Commons
           Version: 1.0 Alpha
          Platform: Macintosh
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: IO
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: bclarke@booksys.com


Using 1.0 release, downloaded from ibiblio

This test will fail for me:

    public void testCommonsIOBug() throws Exception {
        final File fileBefore = new File("Z:\\test");
        System.out.println("Before: " + fileBefore);
        final URL fileURL = new URL("file://" + fileBefore.getAbsolutePath());
        System.out.println("In URL: " + fileURL);
        final File fileAfter = FileUtils.toFile(fileURL);
        System.out.println("After: " + fileAfter);
        assertEquals(fileBefore.getAbsolutePath(), fileAfter.getAbsolutePath());
    }

The output for me is:

Before: Z:\test
In URL: file://Z:/test
After: \test

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