commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeme Praks <>
Subject Re: [net] FTP client date parsing: new format
Date Sat, 16 Apr 2005 12:03:53 GMT

ok, now I checked out the recent changes and the fix seems to work, at 
least in the case of usual files:
-rw-r-----   1 neeme neeme   346 2005-04-08 11:22 services.vsp
is parsed into:
    datestr=2005-04-08 11:22
And this is correct.

However, it still breaks in the case of symbolic links.
So, if the entry is a symbolic link:
lrwxrwxrwx   1 neeme neeme    23 2005-03-02 18:06 macros -> 
then it is parsed into these variables:
   datestr=2005-03-02 18:06 macros
   endtoken= ../../../global/macros/

The ending of "-> ../../../global/macros/" seems to confuse the regexp 

And to answer Rorys question about the specifics of the FTP server, I'll 
paste one of my earlier posts here:
This format is from the default FTP server daemon configuration that 
came with Debian:
Connected to stf.
220 stf FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (stf:neeme): neeme
331 Password required for neeme.
230- Linux stf 2.6.11 #1 SMP Wed Mar 2 14:08:21 CET 2005 i686 GNU/Linux
230- The programs included with the Debian GNU/Linux system are free 
230- the exact distribution terms for each program are described in the
230- individual files in /usr/share/doc/*/copyright.
230- Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
230- permitted by applicable law.
230 User neeme logged in.
Remote system type is UNIX.
Using binary mode to transfer files.


Neeme Praks wrote:

> AFAIK, the new system uses both: regexp for extracting the timestamp 
> from the entry line and then using DateFormat to parse that.
> Example:
> -rw-r--r--    1 1000     1000           27 Jan 24 11:31 messages.vsp
> from this line the regexp extracts the timestamp part ("Jan 24 11:31") 
> and then DateFormat is used to parse this to a valid Date object.
> The issue here is that the failure is already at regexp matching, and 
> the code never reaches the DateFormat parsing part.
> I'll try to check out Rory's changes during the weekend.
> Rgds,
> Neeme
> Steve Cohen wrote:
>> No, that's not it at all.  Remember that the new system does not use 
>> Regexes for date parsing, it uses SimpleDateFormats.  From Mr. Praks' 
>> descriptions, I am assuming he's now running the 1.3 or earlier 
>> versions, which do use regexes.
>> This surprises me because I've had several conversations with him 
>> over the past month in which the new system was discussed.  Perhaps 
>> he forgot to specify the date format as "yyyy/MM/dd" in his 
>> FTPClientConfig this time?  Or perhaps his code is finding an older 
>> commons-net.jar than he was expecting?
>> Steve Cohen
>> Rory Winston wrote:
>>> Right, the problem with this format is that the date is not composed 
>>> of three discrete components (from a regex POV), but two. Basically 
>>> what we will need to do is expand the regex to handle thuis - can 
>>> you give me details of the FTP server operating system and FTP 
>>> server software version if you have it please.
>>> Cheers
>>> Rory

View raw message