[ 
https://issues.apache.org/jira/browse/VFS-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14906900#comment-14906900
 ] 

Simon Legner commented on VFS-515:
----------------------------------

I don't understand why everything except the schema (i.e., 
{{//localhost/etc/hosts}}) is put in the {{file}} part 
({{org/apache/commons/vfs2/provider/AbstractFileObject.java:1550}}) …

> AbstractFileObject.getURL() returns flaky URL object
> ----------------------------------------------------
>
>                 Key: VFS-515
>                 URL: https://issues.apache.org/jira/browse/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
(v6.3.4#6332)

Reply via email to