commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serge.si...@mpsa.com
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 UnixFTPEntryParser.java ? It
would have been really easier for me to diagnose the problem with the
exception thrown away.
            try
            {
                file.setTimestamp(super.parseTimestamp(datestr));
            }
            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).

Cordialement.

--
Serge SIMON
Pôle Composants Pyramide - DSIN/SIFA/GPRO/GPD1
email : serge.simon@mpsa.com
tél. : (03 81) 33 02 22


                                                                           
             Rory Winston                                                  
             <rwinston@eircom                                              
             .net>                                                    Pour 
                                       Jakarta Commons Users List          
             20/11/2006 23:47          <commons-user@jakarta.apache.org>   
                                                                        cc 
                                                                           
                 Veuillez                                            Objet 
                répondre à             Re:  [NET] empty result with        
             Jakarta Commons           listFiles () method whereas I       
                Users List             should get files                    
             <commons-user@ja                                              
             karta.apache.org                                              
                    >                                                      
                                                                           
                                                                           
                                                                           




Hi

FTPClient should be able to handle this issue - see

http://svn.apache.org/viewvc/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java?revision=165675&view=markup


specifically, the setDefaultFormatDateString()

Thanks
Rory

serge.simon@mpsa.com 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
launched
> 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
LIST
> 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
line
> (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: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message