commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shon Vella (JIRA)" <>
Subject [jira] [Created] (VFS-515) AbstractFileObject.getURL() returns flaky URL object
Date Wed, 05 Mar 2014 19:38:45 GMT
Shon Vella created VFS-515:

             Summary: AbstractFileObject.getURL() returns flaky URL object
                 Key: VFS-515
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.0, 2.1
         Environment: OSX 10.9.2
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
            Reporter: Shon Vella

URL returned is created with constructor that expects host as a separate parameter from path
and passes in empty string for host. As a result subsequent calls to url.getHost() returns
an empty string rather than the host encoded in the path.

Test Code

FileSystemManager fsManager = VFS.getManager();
FileObject f = fsManager.resolveFile("ftp://localhost/etc/hosts");
URL url = f.getURL();
String host = url.getHost();
assertEquals("localhost", host);

This message was sent by Atlassian JIRA

View raw message