Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.2k views
in .NET FTP by (140 points)
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(); }

1 Answer

0 votes
by (162k points)
Hard to tell from the code posted. Are you already in the directory the second time when you try to chdir()?

Categories

...