mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Francia <and...@andreafrancia.it>
Subject Re: Why FtpFile#listFiles() require that the file list is ordered?
Date Thu, 09 Oct 2008 10:48:37 GMT
Emmanuel Lecharny wrote:
> Andrea Francia wrote:
>> Emmanuel Lecharny wrote:
>>> Does it sounds a good idea ?
>> I think that before designing a new method we will ask ourself if 
>> there is a Use Case where it is used.
> Good point. So is it important that the files are sorted or not sorted 
> ? Do we have some use cases  for it ?
> IMHO, I would rather prefer dealing with files sorted in @ order when 
> I ask for a file list : as a user, if this method returns a sorted 
> list, this is less work I have to do on my side.
What you mean with "user"? The user of the ftp client or the user of the 
FtpFile#listFiles() method?
We have:

ftp client user ---> ftpclient ---> ftpservercore --> ftplet implementation

the ftp client user is not concerned about ftplet implementation because 
the ftpclient is designed to work with many ftpservers even those that 
does not return files in alfabetical order.

The ftpservercore does not need to an ordered list of files because it 
is not required to implement the FTP protocol.

The ftp client user will receive no or little benefits if the ftplet 
implementation order the files because:
 - many ftp client implements ordering in the client side
 - the preferred order may vary from user to user, and may vary from 
time to time.

I think that any ftplet implementation should choose if ordering or not 
its FtpFile#listFiles()  results.

Andrea Francia

View raw message