Can you send me the code snippet?
The code snippet as follows:
class GetFileList {
private FTPClient fc;
public GetFileList(){
ConfigFile cf=new ConfigFile(System.getProperty("user.dir")+"\\ftp.properties");
String hostStr=cf.getValue("FtpServer");
String portStr=cf.getValue("FtpPort");
String userStr=cf.getValue("FtpUserName");
String passStr=cf.getValue("FtpPassword");
try{
fc=new FTPClient(hostStr);
FTPMessageCollector listener = new FTPMessageCollector();
fc.setMessageListener(listener);
fc.login(userStr,passStr);
// set up passive ASCII transfers
//log.debug("Setting up passive, ASCII transfers");
fc.setConnectMode(FTPConnectMode.PASV);
fc.setType(FTPTransferType.ASCII);
String[] files = fc.dir(".", true);
for (int i = 0; i < files.length; i++)
System.out.println(files[i]);//log.debug(files[i]);
// fc.get("123.txt","123.txt");
FTPFile[] fFile=fc.dirDetails(".");
//print(fFile);
for(int i=0 ;i<fFile.length;i++)
{
System.out.println(fFile[i].getName());
}
fc.quit();
}catch(Exception e)
{ e.printStackTrace(); }
}
}
The snippet is my Test code,You dont consider my syntax,beacause the snippet is inner class.
Otherwise ,nice to meet you,thank you
________
Zx14 vs hayabusa