commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [net] NT FTP Server & DIRSTYLE (was Re: [net] [vote] Release Commons-Net 1.2)
Date Thu, 01 Apr 2004 13:08:58 GMT
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.


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();
            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:
For additional commands, e-mail:

View raw message