On 14 September 2010 14:50, Nicolas Delsaux <[email protected]> wrote: > 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://u...@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 ?
If the path really contains: /mnt/data/data_files/path%0/ then try using /mnt/data/data_files/path%250/ where % is replaced by %25. > Thanks > > -- > Nicolas Delsaux > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
