commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Jeffrey D. Brekke)
Subject Re: [net] SYST/FTPClient.getSystemName()
Date Tue, 30 Dec 2003 18:13:22 GMT

Two additional ideas:

1) What about defining one parser implementation, and having the regular
expressions vary based on system?

2) Use host name/ip address to also select the parser/RE.  I was
thinking then one could have a properties file or something setup with
the parser to use ( off the top of my head, not much thought into this

VMS=[fq parser classname] or [ regular expression ]

Then if there is no specific host/ip listing, default to the system
name mapping, else the default parser ( which could also be customized

>>>>> On Tue, 30 Dec 2003 12:13:36 -0600, steve cohen <>

> Well, it sounds like only OS2 and Enterprise Unix are problematical.
> I Googled "OS2 FTP" and I can't find a single publicly accessible
> FTP site that runs OS2.  I did find this page:


> which lists dozens of ftp sites RELATED to OS2.  The majority of
> them are defunct and those that are still live are running on unix
> servers.  But for now, it will be fine to use the "OS/2" key.  If
> anyone can provide more accurate information, please send it on and
> we'll be happy to include it.

> As for "Enterprise Unix", since it doesn't seem to identify itself
> as anything different from regular Unix, we won't be able to provide
> auto-detection.

> What I am envisioning now is a factory method like this:

> public static FTPFileEntryParser createFileEntryParser(String key);

> where key could be either one of the known strings ("UNIX", "OS/2",
> "Windows", or "VMS") or else a fully qualified class name of a class
> that implements FTPFileEntryParser (to accomodate Enterprise Unix
> and any user-written parsers that may be out there).  If there are
> other versions of these keys in existence, they, too can be allowed;
> we can have a many to one mapping between keys and parsers.

> This API would be exposed to outside clients such as Ant.  The ant
> <ftp> task can be rewritten to have an additional attribute called,
> say, "servertype" that the user can supply and the code rewritten to
> instantiate this parser and use it.  This method can also be the
> guts behind an autodetection scheme yet to be written.

> On Tuesday 30 December 2003 08:58 am, Jeffrey D. Brekke wrote:
>> For OS2 we check if the string OS/2 is present.  For NT we check if
>> the string Windows is present.  For VMS we check if the string VMS
>> is present.
>> This way we don't have to mess with version numbers and stuff.  The
>> actual returns that I can verify are:
>> AIX v5.1L: UNIX Type: L8 Version: BSD-44 Linux (Redhat/wu): UNIX
>> Type: L8 OpenVMS: VMS OpenVMS V7.1 on node XXXXXX.  Windows
>> NT/2000: Windows_NT version 4.0 Windows_NT Windows_NT version 5.0
>> The Enterprise for UNIX 1.2.05 Secure FTP server we've encountered
>> also reports: UNIX Type: L8 and does not have a normal unix
>> listing.  That is why we needed to write a special parser for that
>> one.
>> We no longer have OS/2 servers available.
>> >>>>> On Tue, 30 Dec 2003 07:16:05 -0600, steve cohen >>>>>
>> <> said:
>> >
>> > [originally posted in a slightly different form on commons-dev,
>> now > cross-posting to commons-user]
>> >
>> > I am beginning the work of tying the selection of a specific >
>> FTPFileEntryParser in commons-net to the output of the SYST command
>> > on that system.  (getSystemName() is a wrapper around SYST).  The
>> > goal of this is to enable clients of this code (such as Ant) to
>> be > able to select specific parsers without tying themselves too
>> closely > to the internals of commons-net, i.e., knowing the
>> package names and > class names of each of the parsers.
>> >
>> > To that end, I would like to compile a list of
>> SYST/getSystemName() > outputs on each of the different system
>> types, so we can code a > mapping for this.  Eventually, it may
>> even lead to an auto-detect > functionality.
>> >
>> > I know that a default unix FTP server will return "UNIX".  Will >
>> those who use this code on other systems be so kind as to help me >
>> fill in this table?
>> >
>> > Commons-Net Parser Type that Return Value succesfully parses
>> entries > from getSystemName() ---------------------------- >
>> -------------------- UnixFTPEntryParser UNIX NTFTPEntryParser ?  >
>> OS2FTPEntryParser ?  EnterpriseUnixFTPEntryParser ?  >
>> VMSFTPEntryParser ?
>> >
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> > For additional
>> commands, e-mail:

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

Jeffrey D. Brekke                         
Wisconsin,  USA                           

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

View raw message