commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vogel, Timothy" <>
Subject RE: [VFS] Sample sftp connect
Date Sun, 20 Mar 2005 19:26:57 GMT
	Thanks for the quick reply!

	You are correct; the file format from the server does not match
what VFS is expecting.  I suspect that is because the server is actually
a Windows server rather than a *nix server.  The format is <size> <date>
<time> <name>.
       0  Mar 20, 2005 05:30 ./
       0  Mar 20, 2005 05:30 ../
       0  Mar 20, 2005 04:42 EndInv/
       0  Mar 20, 2005 04:42 InvRec/
       0  Oct 30, 2003 03:10 Payroll/
       0  Mar 20, 2005 04:42 RPI/
       0  Mar 20, 2005 04:42 Sales/
       0  Mar 20, 2005 04:42 SOS/
       0  Mar 20, 2005 05:48 TLD/
       0  Mar 20, 2005 04:42 Transfers/
       0  Oct 31, 2003 13:53 wfm/

	  I can override the doListChildren method of the SftpFileObject
with this format.  Before I do that is there a standard way in VFS to
handle different file listings?

Timothy Vogel

-----Original Message-----
From: Mario Ivankovits [] 
Sent: Sunday, March 20, 2005 11:54 AM
To: Jakarta Commons Users List
Subject: Re: [VFS] Sample sftp connect

Vogel, Timothy wrote:
>org.apache.commons.vfs.FileSystemException: Could not list the contents
>of folder sftp://user@server/somedir ".
>at com.yum.vfs.example.SftpShell.listChildren(
>at com.yum.vfs.example.SftpShell.handleCommand(
>at com.yum.vfs.example.SftpShell.go(
>at com.yum.vfs.example.SftpShell.main(> 
>Caused by: java.util.NoSuchElementException
>at java.util.StringTokenizer.nextToken(
It looks like VFS has some problems in parsing your directory listing. 
Could you please try the following code and post the output (or send by 
private mail if you dont want to expose it)
Replace the YOUR_* stuff by the corresponding values.

        JSch jsch = new JSch();
        Session session = jsch.getSession("YOUR_USER",
        session.setUserInfo(new TrustEveryoneUserInfo());
        ChannelSftp channel = (ChannelSftp) session.openChannel("sftp");
        Vector vector ="YOUR_DIR");
        Iterator iterVector = vector.iterator();
        while (iterVector.hasNext())


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

This communication is confidential and may be legally privileged.  If you are not the intended
recipient, (i) please do not read or disclose to others, (ii) please notify the sender by
reply mail, and (iii) please delete this communication from your system.  Failure to follow
this process may be unlawful.  Thank you for your cooperation.

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

View raw message