commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Storch (JIRA)" <>
Subject [jira] [Commented] (VFS-340) FileSystemException: Badly formed URI
Date Tue, 18 Feb 2014 23:45:22 GMT


Jon Storch commented on VFS-340:

Hello.  I should have been clearer.
I didn't make a code change, the solution is to Url encode the username and password before
calling resolveFile();

So if you need to call something like:
Where the username is "sftpuser@Location" and the password is "Test!@#$%^&*[]:;:
you encode just the username and password and call it like:

It might look a bit messy as a Sting but in the calling code there isn't much of a problem.

Does this make sense?

> FileSystemException: Badly formed URI 
> --------------------------------------
>                 Key: VFS-340
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: windows XP, JDK1.5
>            Reporter: bharani
>   Original Estimate: 96h
>  Remaining Estimate: 96h
> I am trying to connect to SFTP using commons.vfs . The program is running fine initially
by connecting to SFTP and retrieving files ,but after one point of time it throws following
exception repeatedly and refuses to connect thereafter.
> FileSystemException: Badly formed URI  "sftp://sftpuser:XXXXXXXX@US456564/home57556/".
> 	at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(
> 	at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(
> 	at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at org.quartz.simpl.SimpleThreadPool$
> Caused by: org.apache.commons.vfs.FileSystemException: Port number is missing from URI
> 	at org.apache.commons.vfs.provider.HostFileNameParser.extractPort(
> 	at org.apache.commons.vfs.provider.HostFileNameParser.extractToPath(
> 	at org.apache.commons.vfs.provider.URLFileNameParser.parseUri(
> 	at org.apache.commons.vfs.provider.AbstractFileProvider.parseUri(
> 	at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(
> 	... 8 more

This message was sent by Atlassian JIRA

View raw message