commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [NET] empty result with listFiles () method whereas I should get files
Date Tue, 21 Nov 2006 09:08:52 GMT

Hello Rory,

Indeed, but that mean that I would have to put in my code something like
"for this server, use this format", whereas any other server use the same
format. And if tomorrow I have to work with a new server, I would have to
add another case for the new server if its date format setting is not the
usual one.

So as long as FTPClient can't handle this automatically, I'd prefer to have
all FTP servers using the same date format.

I have two last remarks / questions :

1. Why the ParseErrorException is hidden in ? It
would have been really easier for me to diagnose the problem with the
exception thrown away.
            catch (ParseException e)
                  return null;  // this is a parsing failure too.

2. How other tools (like Filezilla and others ftp client) can handle the
various ftp server LIST format (indeed, excepted with the unix ftp command
line tool, nearly all other tools work fine on any machine, regardless of
the date format used).


Pôle Composants Pyramide - DSIN/SIFA/GPRO/GPD1
email :
tél. : (03 81) 33 02 22

             Rory Winston                                                  
             .net>                                                    Pour 
                                       Jakarta Commons Users List          
             20/11/2006 23:47          <>   
                 Veuillez                                            Objet 
                répondre à             Re:  [NET] empty result with        
             Jakarta Commons           listFiles () method whereas I       
                Users List             should get files                    


FTPClient should be able to handle this issue - see

specifically, the setDefaultFormatDateString()

Rory wrote:
>> Hmm. So you say that listFiles() actually returns a list of filenames?
>> Without actually being able to access your setup, its difficult to know
> where to look - are you in a position to to debug/step through the
> FTPClient code?
> Well, how could I have not seen this before ...
> Thank you very much for your suggestion : I was until now launching my
> class from a unix server, without debugging capacities. I've just
> it from Eclipse and have stepped the FTPClient code, and in the end, it's
> just a date parsing problem.
> The server on which it doesn't work returns dates like that (through a
> command) :
> "25 sep 13:38" (french date format i guess)
> instead of "Sep 25 13:38" (which is the format used on any other machine)
> (problem found in "parseFTPEntry()" on "file.setTimestamp(super
> .parseTimestamp(datestr));" which throws an Exception)
> Damn, i haven't seen that when I emulated ftp through a telnet-command
> (whereas at that time, i already had another date format returned by this
> ftp server) ...
> I'll see if I can modify the date format on the ftp server (maybe the
> easiest solution for me).
> Thanks again for your help.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message