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 Wed, 07 Jan 2004 00:38:00 GMT
On Tuesday 06 January 2004 05:53 pm, Daniel F. Savarese wrote:


>
> I think FTPFileEntryParser is the key to customization.  All of our
> problems would be solved if instead of a static FTPFileList.create
> method, there were a per-instance FTPFileList createFileList method
> in FTPFileEntryParser.  Although, in that case it would help for
> FTPFileList to be an interface.  Since FTPFileList has a private
> constructor and API users can only create instances with create(),
> maybe we can make FTPFileList an abstract class without breaking
> anything and move the current implementation into a subclass.
> FTPClient would use the parser createFileList method and VMSFileEntryParser
> would return an FTPFileList subclass that did the right thing, either
> by producing a filtering iterator derived from FTPFileIterator or by
> redefining the way the stream is read.  I'm not saying this is the best
> way to go, but it does offer more flexibility than either of our previous
> suggestions without breaking anything.  At any rate, it's another idea to
> throw into the pot.  Let's brainstorm some more and make a list of pros
> and cons.
>
> daniel

I like where you're going here.  You are untying knots.  This is good.  If we 
polymorphize file list creation and let the parser dictate which type it 
creates, that would get us where we want to go and put the solution in the 
right place.  Possibly there might need to be a polymorphic iterator too.  
Something like DupeRemovingFTPFileIterator.

Also, I'm not sure we're doing the right thing now anyway.  What we're doing 
doesn't guarantee getting the most recent version.  The way it currently 
works is the last version encountered is used.  But does anything guarantee 
that the listing comes out in version order?  I don't know anything about VMS 
but no other OS I know makes such a guarantee.  If I'm right, then instead of 
doing a simple Hashtable.put() we need to do a get() first, and then put() 
only if get() returned null or if the new FTPFile has a higher version number 
than the one retrieved.



---------------------------------------------------------------------
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