Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.6k views
in Java FTP by (260 points)
FileTransferClient ftpClient = getNewFtpConn();
FTPFile[] ftpFiles = ftpClient.directoryList(remoteFileNameReg);
for(FTPFile ftpfile:ftpFiles)
System.out.println(ftpfile.getName());

it works. but one day, the name all are empty。why?

change to :

remoteFiles = ftpClient.directoryNameList();

it works.

5 Answers

0 votes
by (162k points)
Post a log file and we'll let you know
0 votes
by (260 points)
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.359 : ListenOnAllInterfaces=true
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.359 : ---> PORT 10,153,170,249,8,176
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.375 : 200 PORT command successful.
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.375 : ---> LIST *.fav*
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.406 : 150 Opening BINARY mode data connection for /usr/bin/ls.
DEBUG [FTPActiveDataSocket] 14 七月 2009 12:41:45.421 : Calling accept()
DEBUG [FTPActiveDataSocket] 14 七月 2009 12:41:45.421 : accept() succeeded
ALL [FTPClient] 14 七月 2009 12:41:45.421 : -rw-r--r-- 3 bill2 billing 3143 7月14日 12:40 G20090714124023C.fav20090714C
ALL [FTPClient] 14 七月 2009 12:41:45.421 : -rw-r--r-- 3 bill2 billing 4824 7月14日 12:40 I20090714124023C.fav20090714C
ALL [FTPClient] 14 七月 2009 12:41:45.421 : -rw-r--r-- 3 bill2 billing 41180 7月14日 12:40 P20090714124023C.fav20090714C
DEBUG [FTPActiveDataSocket] 14 七月 2009 12:41:45.421 : closeChild() succeeded
DEBUG [FTPActiveDataSocket] 14 七月 2009 12:41:45.421 : close() succeeded
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.593 : 226 Transfer complete.
DEBUG [FTPFileFactory] 14 七月 2009 12:41:45.593 : Confirmed format UNIX
INFO [FTPFileFactory] 14 七月 2009 12:41:45.593 : Trying zh_CN locale
DEBUG [FTPFileFactory] 14 七月 2009 12:41:45.593 : Ignoring date parsing errors
NAME--------------->
NAME--------------->
NAME--------------->
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.593 : ---> MDTM
DEBUG [FTPControlSocket] 14 七月 2009 12:41:45.593 : 500 'MDTM ': command not understood.
INFO [FTPControlSocket] 14 七月 2009 12:41:45.593 : Expected reply code = [213]
Exception in thread "main" com.enterprisedt.net. ftp.FTPException: 500 'MDTM ': command not understood.
at com.enterprisedt.net. ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1149)
at com.enterprisedt.net. ftp.FTPClient.modtime(FTPClient.java:3606)
at com.enterprisedt.net. ftp.FileTransferClient.getModifiedTime(FileTransferClient.java:733)
at Test Ftp.getDownloadVos(TestFtp.java:84)
at Test Ftp.main(TestFtp.java:112)
0 votes
by (260 points)
ALL [FTPClient] 14 七月 2009 13:00:54.656 : -rw-r--r-- 1 bill2 billing 2667063 6月 6日 23:53 PHS0606.565.Q
ALL [FTPClient] 14 七月 2009 13:00:54.656 : -rw-r--r-- 1 bill2 billing 712 6月 6日 21:16 PHS0606.566.C
ALL [FTPClient] 14 七月 2009 13:00:54.656 : -rw-r--r-- 1 bill2 billing 712 6月 6日 23:10 PHS0606.566.P
ALL [FTPClient] 14 七月 2009 13:00:54.656 : -rw-r--r-- 1 bill2 billing 1958 6月 6日 21:23 PHS0606.566.Q
DEBUG [FTPActiveDataSocket] 14 七月 2009 13:00:54.656 : closeChild() succeeded
DEBUG [FTPActiveDataSocket] 14 七月 2009 13:00:54.656 : close() succeeded
DEBUG [FTPControlSocket] 14 七月 2009 13:00:54.765 : 226 Transfer complete.
DEBUG [FTPFileFactory] 14 七月 2009 13:00:54.765 : Confirmed format UNIX
INFO [FTPFileFactory] 14 七月 2009 13:00:54.765 : Trying zh_CN locale
DEBUG [FTPFileFactory] 14 七月 2009 13:00:54.765 : Ignoring date parsing errors
NAME--------------->PHS0606.550.C
NAME--------------->PHS0606.550.P
NAME--------------->PHS0606.550.Q
NAME--------------->PHS0606.551.C
0 votes
by (260 points)
ALL [FTPClient] 14 七月 2009 13:06:14.453 : -rw-r--r-- 1 bill2 billing 2697501 6月10日 23:51 PHS0610.565.Q
ALL [FTPClient] 14 七月 2009 13:06:14.453 : -rw-r--r-- 1 bill2 billing 801 6月10日 22:38 PHS0610.566.C
ALL [FTPClient] 14 七月 2009 13:06:14.453 : -rw-r--r-- 1 bill2 billing 1068 6月10日 20:17 PHS0610.566.P
ALL [FTPClient] 14 七月 2009 13:06:14.453 : -rw-r--r-- 1 bill2 billing 2136 6月10日 22:26 PHS0610.566.Q
DEBUG [FTPActiveDataSocket] 14 七月 2009 13:06:14.453 : closeChild() succeeded
DEBUG [FTPActiveDataSocket] 14 七月 2009 13:06:14.453 : close() succeeded
DEBUG [FTPControlSocket] 14 七月 2009 13:06:14.750 : 226 Transfer complete.
DEBUG [FTPFileFactory] 14 七月 2009 13:06:14.750 : Confirmed format UNIX
INFO [FTPFileFactory] 14 七月 2009 13:06:14.750 : Trying zh_CN locale
DEBUG [FTPFileFactory] 14 七月 2009 13:06:14.750 : Ignoring date parsing errors
NAME--------------->
NAME--------------->
NAME--------------->
NAME--------------->
0 votes
by (162k points)
It looks like your locale may be set incorrectly?

Categories

...