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