File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes error in rm method of J2SSH Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "error in rm method of J2SSH" Watch "error in rm method of J2SSH" New topic
Author

error in rm method of J2SSH

Vishal Methi
Ranch Hand

Joined: Jan 14, 2004
Posts: 52
Hi ,
I have to remove files from SSH Server. I am using J2SSH.

I have written method to remove two files/directory from server. First directory is getting deleted successfully.
But deleting the 2nd directory i m getting the exception.

Below is my code and exception both.

Code :
public void removeFilesFromFTPServer (SftpClient sftp)
{
try {
sftp.rm("FBCHKBFHLLJEPIIMNJCP1231233677791"); // Running successfully
sftp.rm("MDCMAOCMAEBABMBHPHPL1231233677791"); // Here i m getting exception
}catch(IOException ioe)
{
ioe.printStackTrace();
}

Exception :

java.io.IOException: Failure
at com.sshtools.j2ssh.sftp.SftpSubsystemClient.getOKRequestStatus(Unknown Source)
at com.sshtools.j2ssh.sftp.SftpSubsystemClient.removeDirectory(Unknown Source)
at com.sshtools.j2ssh.SftpClient.rm(Unknown Source)

Could you please help me what may be the reason.

Thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Did you look at the docs? Does the directory have to be empty for "rm" to remove it? Is it empty?


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: error in rm method of J2SSH
 
Similar Threads
Problem Deploying Applet
applet socketpermissions
java.io.IOException: There is not enough space on the disk JNLP
Head First Java book, chapter 15 - help needed with running the chat terminals
getReplyString() equivalent method for j2ssh