you are geniuses. Thank you very much!
I solved my problem!
This is my test method:
public static boolean DelDirectory(ChannelSftp chanSftp, String sPath) throws SftpException {
boolean bEnd = true;
Vector<ChannelSftp.LsEntry> files = chanSftp.ls(sPath);
for (ChannelSftp.LsEntry entry : files) {
if (entry.getAttrs().isDir()) {
if (!entry.getFilename().equals(".") && !entry.getFilename().equals("..")) {
bEnd = false;
bEnd = DelDirectory(chanSftp, sPath + "/" + entry.getFilename());
if (bEnd) {
chanSftp.rmdir(sPath + "/" + entry.getFilename());
}
}
} else {
chanSftp.rm(sPath + "/" + entry.getFilename());
}
}
return bEnd;
}
I would just like to ask you for a clarification.
As development environment I use NetBeans and it tells me that the Vector is an obsolete collection.
What can I replace it with?