I have just begun using FTPClient and have no previous experience with FTP.
I have a list of my website files displayed in a JList in my Java GUI. When I select a file and click the delete button, the file is deleted from the server. If I select another file and click delete, the second time around, the second file is not deleted.
I am missing something in between the first and second time for this to work.
if(label.equals("Delete")) {
try {
String file = (String)fileList.getSelectedValue();
ftp.chdir(dir);
ftp.delete(file);
listModel.removeElement(file);
} catch(Exception ex) { ex.toString(); }