Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2SSH - SFTPFile

 
Kranti Datrange
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you need to open the file first? Who do the various file checks say about the files existence and whatnot?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic