commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Delsaux <>
Subject [VFS][SFTP] Unable to navigate to directory
Date Wed, 15 Sep 2010 08:51:15 GMT
Hi all
following my previous question, I have a new issue regarding
navigation to a SFTP directory.
I connect to a remote SFTP server by first creating a FileObject
linked to its root folder, then I try to open a subdirectory by
calling resolveFile, but it seems to fail "in the middle". Here is the
code :

			FileObject root = fsManager.resolveFile("sftp:username:password@server/");
			FileObject target =

			return target.getChildren().length>0;

I initially used target.exists(), but as it did not seems to work, I
tried to check for directory content, but it also fails.
Notice that when I ssh "by hand" to this server (with same username
and password), I can without any trouble navigate to this directory.
I done further exploration and notice that writing, in my debug
console the following succeeded


while the following failed


with this exception

org.apache.commons.vfs.FileSystemException: Could not list the
contents of "sftp://root:perigee@quasar/appli/perigee_63D/data"
because it is not a folder.
	at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(
	at org.apache.commons.vfs.provider.AbstractFileObject.getChild(
	at com.perigee.svnsync.SftpExecutor.existsContent(
	at com.perigee.svnsync.SvnSynchronizer.examineRelease(
	at com.perigee.svnsync.SvnSynchronizer.synchronize(
	at com.perigee.svnsync.Main.main(

Unfortunatly, a ls indicates that

total 1
drwxr-xr-x  3 root root  72 Jan 25  2010 .
drwxr-xr-x 20 root root 880 Sep  6 09:30 ..
drwxr-xr-x  5 root root 128 Mar 31 18:11 files

yes, as I expected, files is a directory.

Notice that I can also do all those SSH operations using, as an
example, WinSCP. Which leads me to think that this may not be a
server-side issue, but rather a problem with my use of commons VFS.

So, have you got any suggestions regarding this particular issue ?

Nicolas Delsaux

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message