Hi In answer to your questions:
1. Its a good point about the ParseException being swallowed, I'll make a note to have a look at that. 2. This is probably just a result of the way that the client parsing code was developed (on the assumption that the date format would be one of a certain number of possibilities). 95% of the time, this is a correct assumption, but there are certain cases (like yours) where you need to manually tell FTPClient what the format is. I suspect the simple answer is that FileZilla et al. simply have a more sophisticated date parsing implementation. It may be instructive to have a look at what they actually do. Thanks Rory "Jakarta Commons Users List" <[email protected]> wrote: > > > > > > Hello Rory, > > Indeed, but that mean that I would have to put in my code something lik= > e > "for this server, use this format", whereas any other server use the sa= > me > 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 t= > he > 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 ? I= > t > 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 th= > e > various ftp server LIST format (indeed, excepted with the unix ftp comm= > and > line tool, nearly all other tools work fine on any machine, regardless = > of > the date format used). > > Cordialement. > > -- > Serge SIMON > P=F4le Composants Pyramide - DSIN/SIFA/GPRO/GPD1 > email : [EMAIL PROTECTED] > t=E9l. : (03 81) 33 02 22 > > > = > > Rory Winston = > > <[EMAIL PROTECTED] = > > .net> P= > our > Jakarta Commons Users List = > > 20/11/2006 23:47 <[EMAIL PROTECTED] > > > = > cc > = > > Veuillez Ob= > jet > r=E9pondre =E0 Re: [NET] empty result with= > > Jakarta Commons listFiles () method whereas I = > > Users List should get files = > > <[EMAIL PROTECTED] = > > 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?revisio= > n=3D165675&view=3Dmarkup > > > specifically, the setDefaultFormatDateString() > > Thanks > Rory > > [EMAIL PROTECTED] wrote: > > > > > > > >> Hmm. So you say that listFiles() actually returns a list of filename= > s? > >> Without actually being able to access your setup, its difficult to k= > now > >> > > 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 m= > y > > 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 mach= > ine) > > (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-comman= > d > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > = > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ----------------------------------------------------------------- Find the home of your dreams with eircom net property Sign up for email alerts now http://www.eircom.net/propertyalerts --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
