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

Bernd Eckenfels commented on VFS-515:
-------------------------------------

Seems to be a problem of 
org.apache.commons.vfs2.provider.AbstractFileObject.getURL() using 
org.apache.commons.vfs2.provider.UriParser.extractScheme(String, StringBuilder) 
and not limited to FTP.

> 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