Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 8142 invoked from network); 13 Oct 2005 19:01:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2005 19:01:32 -0000 Received: (qmail 25001 invoked by uid 500); 13 Oct 2005 19:01:26 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 24961 invoked by uid 500); 13 Oct 2005 19:01:26 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 24950 invoked by uid 99); 13 Oct 2005 19:01:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2005 12:01:26 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.97.134.82] (HELO severian.loni.ucla.edu) (128.97.134.82) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2005 12:01:27 -0700 Received: from enson.loni.ucla.edu (enson.loni.ucla.edu [10.1.1.101]) by severian.loni.ucla.edu (SGI-8.12.5/8.12.5) with ESMTP id j9DJ123h203171 for ; Thu, 13 Oct 2005 12:01:02 -0700 (PDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: VFS and SFTP, not working? X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Thu, 13 Oct 2005 12:03:51 -0700 Message-ID: <6E624D9CA72AA148932674B863E08FD12B7448@enson.loni.ucla.edu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: VFS and SFTP, not working? Thread-Index: AcXLBz4cOWsZv4spSAuKOwX/c53bHAFIHx1Q From: "Jeff Ma" To: "Jakarta Commons Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The following code will throw an exception, if there is a link file under my directory. But if I use the code snip sent out by Mario a couple days ago, it works, also, ftp is fine. An FileObject file =3D fsManager.resolveFile("sftp://me:passwd/mydirectory",opts); org.apache.commons.vfs.FileSystemException: Invalid descendent file name "MyPictures -> /dir1/dir2/MyPictures". at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveName(Default FileSystemManager.java:616) at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractF ileObject.java:571) at org.apache.commons.vfs.example.MyExample.main(MyExample.java:167) -----Original Message----- From: Mario Ivankovits [mailto:mario@ops.co.at]=20 Sent: Thursday, October 06, 2005 10:18 PM To: Jakarta Commons Users List Subject: Re: VFS and SFTP, not working? Hi! Could you please try the following code snip. It this also hang its most likely a jsch bug. Please replace --whatever-- with your informations. Properties props =3D new Properties(); props.setProperty("StrictHostKeyChecking", "false"); JSch jsch =3D new JSch(); Session session =3D jsch.getSession("--user-name--", "--host--", 22); session.setUserInfo(new UserInfo() { public String getPassphrase() { return null; } public String getPassword() { return null; } public boolean promptPassword(String string) { return false; } public boolean promptPassphrase(String string) { return false; } public boolean promptYesNo(String string) { return true; } public void showMessage(String string) { } }); session.setPassword("--your-password--"); session.connect(); ChannelSftp chan =3D (ChannelSftp) session.openChannel("sftp"); chan.connect(); Vector list =3D chan.ls("--your-directory--"); Iterator iterList =3D list.iterator(); while (iterList.hasNext()) { System.err.println(iterList.next()); } System.err.println("done"); chan.disconnect(); session.disconnect(); Thanks! --- Mario --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org