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] 1.2 release (Re: [net] checked in parser factory implementation)
Date Tue, 06 Jan 2004 22:28:50 GMT
On Tuesday 06 January 2004 04:21 pm, Daniel F. Savarese wrote:
> In message <85znd1aeal.fsf@brekke.org>, Jeffrey D. Brekke writes:
> >Couldn't we handle this with a FilterIterator or some other adapter on
> >the iterator from an FTPFileList?  I never thought of this when the
> >version patch was submitted, but it seems like a possible solution.
> >Better than supporting multiple ways of parsing the list.
>
> I misunderstood what was going on with VMSFTPEntryParser (no point
> in explaining how I was misunderstanding it).  Forget about anything
> I said about parseFileList and let's back out my addition of the method
> to FTPFileEntryParser.  Am I correct to say that VMSFTPEntryParser
> filters out duplicate entries when versioning is turned off?
> If that's the case, attaching an adapter/filter to the iterator is
> a good way to go.  How do we do this transparently?  The way the
> classes fit together right now, I don't see how to slip in an
> adapter transparently.  One way to do it would be to add an
> FTPFileIterator createIterator(FTPFileList) method to
> FTPFileEntryParser and have FTPFileList call that to get the
> iterator in FTPFileList.iterator().  FTPFileListParserImpl
> would return an FTPFileIterator and so would all of its
> subclasses, except VMSFTPEntryParser which would override the
> method and return its own iterator that filters out duplicates
> when versioning is off.  I'm not crazy about my suggestion
> for implementing your suggestion because it's a workaround and we
> shouldn't add new methods to interfaces to handle special cases.  If
> there is a design weakness in the way FTPFileList, FTPFileIterator,
> FTPFileEntryParser, and FTPClient interact, let's nail it down, fix it,
> and migrate.
>
> daniel
>

Almost right, Daniel.  I think it filters out dupes when versioning is turned 
on.

Actually, I like your suggestion.  The iterator seems the right place to do 
it.

Here's another problem, though, in our system.  How do you turn versioning on 
in the auto-detect scenario?  There's no hook in listFiles() for doing so.
>
> ---------------------------------------------------------------------
> 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