commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cohen <sco...@javactivity.org>
Subject Re: [net] NT FTP Server & DIRSTYLE (was Re: [net] [vote] Release Commons-Net 1.2)
Date Thu, 01 Apr 2004 13:20:30 GMT
I think having a Unix parser within the NT parser is not a good design.  I 
think the logical right place to do it is in the factory.  Before I had heard 
about DIRSTYLE I was envisioning a process of getting a test listing when 
SYST returned "Windows" and trying both parsers.  Or some other test.  To be 
done in the factory.  

The DIRSTYLE thing offends because it seems "invasive" but how invasive is it, 
really?  If it only affects the single connection session (which is what I 
would assume), it's not so bad.




On Thursday 01 April 2004 7:08 am, Mario Ivankovits wrote:
> Steve Cohen wrote:
> >So let's here some more comments:  how nasty is this DIRSTYLE toggling
> > thing that some of us are just hearing about for the first time now?
>
> I think we could live with this, but beside this, the question is too,
> how bad it is to implement.
>
> Currently we do have not instance of the FTPClient within the
> EntryParsers, so we have to change createFileEntryParser to
> a) pass a "subtype" (which depends on the host)
> b) to pass the FtpClient instance to do the syst/dirstyle command.
>
> or
>
> c) We do the following withing NTFTPEntryParser
>
>     private final FTPFileEntryParser fallback = new UnixFTPEntryParser();
>     private boolean unixStyle = false;
>
>     public FTPFile parseFTPEntry(String entry)
>     {
>         if (!unixStyle && matches(entry))
>         {
>             FTPFile f = new FTPFile();
> ...cut....
>         }
>         else
>         {
>             unixStyle = true;
>             return fallback.parseFTPEntry(entry);
>         }
>     }
>
>
> Then we do not have to rely on the dirstyle output, and do not have to
> change the interface to the DefaultFTPEntryParser.
> So the ugliness (if you call the above change so ;-) is within the
> initiator - the NTFTPEntryParser and the corresponding host ftp
> implementation :-)
>
>
> If you agree, i could send a patch.
>
> -- Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


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


Mime
View raw message