commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Delsaux <nicolas.dels...@gmail.com>
Subject [VFS][SFTP] access path containing %0
Date Tue, 14 Sep 2010 13:50:51 GMT
Hi all,
I'm trying to access through SFTP and Commons VFS a file in a path
containing the %0 sequence (as an example
sftp://user@server/mnt/data/data_files/path%0/System%20Folder/Librairies/Directory%20Management/LDAP%20Sync/LDAPSync.c)
but each time I do an exception occurs.
More precisely, I can open a FileObject on my SFTP server by doing so :
               FileSystemManager fsManager = VFS.getManager();
               String urlText = "sftp://" + main.sshUsername + ":"
                               + main.sshPassword + "@" +
main.serverAddress + "/";
               FileObject file = fsManager.resolveFile(urlText);

But when i try to resolve the
"/mnt/data/data_files/path%0/System%20Folder/Librairies/Directory%20Management/LDAP%20Sync/LDAPSync.c"
path, I get the following exception :

Exception in thread "main" org.apache.commons.vfs.FileSystemException:
Invalid URI escape sequence "%0/".
       at org.apache.commons.vfs.provider.UriParser.canonicalizePath(UriParser.java:441)
       at org.apache.commons.vfs.provider.URLFileNameParser.parseUri(URLFileNameParser.java:54)
       at org.apache.commons.vfs.provider.AbstractFileProvider.parseUri(AbstractFileProvider.java:170)
       at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveName(DefaultFileSystemManager.java:753)
       at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveName(DefaultFileSystemManager.java:684)
       at org.apache.commons.vfs.provider.AbstractFileObject.resolveFile(AbstractFileObject.java:669)
       at com.company.svnsync.SftpExecutor.copy(SftpExecutor.java:70)

Is there some kind of encoding I could use, as my path really exists
as this on that server ?

Thanks

--
Nicolas Delsaux

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message