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:05:40 GMT
Emmanuel Lecharny wrote:
> Andrea Francia wrote:
>> Niklas Gustavsson wrote:
>>> On Wed, Oct 8, 2008 at 11:44 PM, Andrea Francia 
>>> <andrea@andreafrancia.it> wrote:
>>>> Why should I do this?
>>> Because it's the order that will be returned to the client, and if
>>> it's a long listing it's better to let the implementation do the
>>> ordering than do it afterwards. 
>> I think that sorting should be a client issue and a client decision.
>> The client choose to sort by name, modification time, user, group or 
>> whatever he wants.
>> There is a specification in some RFC that dictate that the FTP server 
>> should return files names in alfabetical order?
> There is none. But does it make any difference ?
> I don't think that sorting the files in alphabetic order is a problem 
> at all. It's just an extra functionality you get for free.
> However, why don't we add a method :
> listFiles( boolean ordered )
> which will return the files ordered - or not - depending on the 
> boolean value ? The original listFiles() will always return an ordered 
> files list (and I really don't see how it can hurts, but maybe there 
> are some corner case where this method should returns the unordered 
> list of files).
> 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.

Andrea Francia

View raw message