This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes J2SSH - SFTPFile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "J2SSH - SFTPFile" Watch "J2SSH - SFTPFile" New topic
Author

J2SSH - SFTPFile

Kranti Datrange
Greenhorn

Joined: Aug 21, 2004
Posts: 3
Dear Friends:
I am using the J2ssh API, I have written a java code to get an Sftpfile as:

sftpClient = ssh.openSftpClient();
List list = sftpClient.ls();
SftpFile sftpfile = (SftpFile) list.get(2);//get single SftpFile
SftpFileInputStream br = new SftpFileInputStream(sftpfile);


when I run the program, I get following error,
++++++++++++++++++++++++++++++++++++++++++
java.io.IOException: The file does not have a valid handle!


Can somebody help me out..
Thanks in advance !!!
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

Maybe you need to open the file first? Who do the various file checks say about the files existence and whatnot?
 
 
subject: J2SSH - SFTPFile
 
Similar Threads
Java API for connecting to SFTP server
Help on sequential method execution
SFTP
getReplyString() equivalent method for j2ssh
error