You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ryan McKinley <ry...@gmail.com> on 2013/01/29 23:56:26 UTC

[VFS] trunk UriParser.normalisePath() problem for resolveFile?

Hello-

I am using trunk VFS and hitting an error when trying to resolve files.
 This simple example demonstrates the problem:

FileObject root = VFS.getManager().resolveFile( "
ftp://atlas.ca.gov/pub/casil/" );
FileObject file = root.resolveFile("
ftp://atlas.ca.gov/pub/casil/transportation/README");

This gets an error:
org.apache.commons.vfs2.FileSystemException: Expecting // to follow the
scheme in URI "ftp:/atlas.ca.gov/pub/casil/transportation/README".

The javadoc on resolveFile says the path can be absolute or relative.

Digging into things, the issue seems to be in:

DefaultFileSystemManager#resolveName

This calls:
UriParser.normalisePath(buffer);

removing the second slash from :// and making an invalid path.

Am I doing something wrong, or is this expected?

thanks
Ryan

Re: [VFS] trunk UriParser.normalisePath() problem for resolveFile?

Posted by Ryan McKinley <ry...@gmail.com>.
Sorry for the double post.

Since my account sent a bunch of spam, I was kicked off the list and my
first message failed.  I think signed up again and now both messages went
through.

thanks
ryan



On Tue, Jan 29, 2013 at 2:56 PM, Ryan McKinley <ry...@gmail.com> wrote:

> Hello-
>
> I am using trunk VFS and hitting an error when trying to resolve files.
>  This simple example demonstrates the problem:
>
> FileObject root = VFS.getManager().resolveFile( "
> ftp://atlas.ca.gov/pub/casil/" );
> FileObject file = root.resolveFile("
> ftp://atlas.ca.gov/pub/casil/transportation/README");
>
> This gets an error:
> org.apache.commons.vfs2.FileSystemException: Expecting // to follow the
> scheme in URI "ftp:/atlas.ca.gov/pub/casil/transportation/README".
>
> The javadoc on resolveFile says the path can be absolute or relative.
>
> Digging into things, the issue seems to be in:
>
> DefaultFileSystemManager#resolveName
>
> This calls:
> UriParser.normalisePath(buffer);
>
> removing the second slash from :// and making an invalid path.
>
> Am I doing something wrong, or is this expected?
>
> thanks
> Ryan
>