How about an FTPEntryParserFactory?
The problem is getting the data for the mappings?  I've never looked
into this.  How consistent are the names returned by getSystemName() in
practice?  Are they locale-dependent?  Once we have a fair sample of
what this data looks like, it would not be hard to write a factory, at
least one that works most of the time.

With an eye to ant, in most ant use cases you will know what system
you're connecting to and what type it is.  The ant <ftp> task can be
rewritten with an optional parameter indicating which parser to use.  I
actually think this a much more common use case than the auto-detect
one.  Documentation of which parser to use for which system would help
almost as much as autodetection.

-----Original Message-----
From: Jeffrey D. Brekke [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 11, 2003 12:11 PM
To: Jakarta Commons Users List
Subject: Re: questions about FTP LIST processing (FTPFileListParser)



We are using getSystemName() which is returning the name of the server's
OS.  We are fortunate that we aren't hitting that many different ftp
servers, so we can search for say, "Windows" and if its in the string,
we may attempt to use the NT parser.

One idea would be to have the regular expressions in a properties file.
If getSystemName() matches, then use the mapping to the RE to use for
parsing the entries.  Then maybe we just need a *generic* entry parser
and well defined RE's for autodetection and selection of parsing.  Maybe
we could even use RE's to match the system name.

>>>>> On Thu, 11 Dec 2003 09:20:26 -0700, Chris Malley 
>>>>> <[EMAIL PROTECTED]> said:

> You mean the OS of the FTP server, right?  How do you determine the OS

> of the FTP server?...

> -Chris

> Jeffrey D. Brekke wrote: [...]
>> Currently, in our code, we just select the parser based on os.  If 
>> you have any ideas or wish to contribute to the autodetection idea 
>> your more than welcome.

> -- Chris Malley Contractor - PixelZoom, Inc.  Email @ EMC: 
> [EMAIL PROTECTED] Voice @ EMC: (303)293-9331 x1235


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
=====================================================================
Jeffrey D. Brekke                                   [EMAIL PROTECTED]
Wisconsin,  USA                                     [EMAIL PROTECTED]
                                                    [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]

Reply via email to