Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.5k views
in Java FTP by (240 points)
Hi,
I'm Student, I started my final project study which is Client FTP using the library edtFTPj,I choose FTP filezilla server for tests.
i found problem in listing the directories and files of the remote FTP server: the connection with FTP server is done succefully but when i write the program to list directories and files i get exceptions it doesnt work i dont know where is exactly the problem just to know i found the same problem in the library FTP4j thats why i change it and choose edtFTPj
my operating system : windows 7
here it is my source code:

package clientft;

import com.enterprisedt.net.ftp.FTPException;
import com.enterprisedt.net.ftp.FTPFile;
import com.enterprisedt.net.ftp.FileTransferClient;
import java.io.IOException;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Clientft {

    
    public static void main(String[] args) {
        
        try {
            
            FileTransferClient ftp=new FileTransferClient();
            ftp.setRemoteHost("127.0.0.1");
            ftp.setUserName("khalid");
            ftp.setRemotePort(21);
            ftp.setPassword("azerty");
            ftp.connect();
           
           FTPFile[] files = ftp.directoryList(".");
            for (int i = 0; i < files.length; i++) {
              System.out.println(files[i].toString());
            }
            //ftp.disconnect();
            
        } catch (Exception ex) {
            Logger.getLogger(Clientft.class.getName()).log(Level.SEVERE, null, ex);
        } 
    }
}

Thank you for the help

7 Answers

0 votes
by (51.6k points)
Please post a debug log. If you don't know how to do that then check the user guide.

- Hans (EnterpriseDT)
0 votes
by (240 points)
please,where can i find it ?
0 votes
by (51.6k points)
I'm sure you can find it if you try.
0 votes
by (240 points)
it's done I guess
0 votes
by (240 points)
Please can someone help me? I'm stuck
0 votes
by (51.6k points)
Please enable logging and post the log messages here.
0 votes
by (162k points)
This is almost always a firewall problem. Try disabling the client-side firewall.

Categories

...