You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "DevNull43 (JIRA)" <ji...@apache.org> on 2010/03/02 02:08:05 UTC

[jira] Created: (FTPSERVER-351) LIST and NLIST duplicates comparator if implementing your own sorting.

LIST and NLIST duplicates comparator if implementing your own sorting.
----------------------------------------------------------------------

                 Key: FTPSERVER-351
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-351
             Project: FtpServer
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0.3
            Reporter: DevNull43
            Priority: Critical


LIST and NLIST commands sort Files by name, first directories and then files.

LIST only takes argument -a
NLIST only takes argument -a and -l

Sorting must be done also by SIZE and DATE.

The comparator for sorting files by name is located in org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java inside method listFiles().

This is wrong if we want to overwrite DirectoryListener to add more arguments for ordering by SIZE or DATE.

NativeFtpFile should not run comparator to avoid running it twice.

The RFC does not require different sorting options, however when number of files is big, sorting by size of date is a must.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FTPSERVER-351) LIST and NLIST duplicates comparator if implementing your own sorting.

Posted by "DevNull43 (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839965#action_12839965 ] 

DevNull43 commented on FTPSERVER-351:
-------------------------------------

After trying to implement my own sorting method, due list comes already sorted by name and immutable, I get:

java.lang.UnsupportedOperationException
	at java.util.Collections$UnmodifiableList$1.set(Collections.java:1244)
	at java.util.Collections.sort(Collections.java:221)
	at org.apache.ftpserver.command.impl.listing.DirectoryLister.sortFilesByDate(DirectoryLister.java:85)
	at org.apache.ftpserver.command.impl.listing.DirectoryLister.traverseFiles(DirectoryLister.java:47)
	at org.apache.ftpserver.command.impl.listing.DirectoryLister.listFiles(DirectoryLister.java:132)
	at org.apache.ftpserver.command.impl.LIST.execute(LIST.java:126)

> LIST and NLIST duplicates comparator if implementing your own sorting.
> ----------------------------------------------------------------------
>
>                 Key: FTPSERVER-351
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-351
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.3
>            Reporter: DevNull43
>            Priority: Critical
>
> LIST and NLIST commands sort Files by name, first directories and then files.
> LIST only takes argument -a
> NLIST only takes argument -a and -l
> Sorting must be done also by SIZE and DATE.
> The comparator for sorting files by name is located in org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java inside method listFiles().
> This is wrong if we want to overwrite DirectoryListener to add more arguments for ordering by SIZE or DATE.
> NativeFtpFile should not run comparator to avoid running it twice.
> The RFC does not require different sorting options, however when number of files is big, sorting by size of date is a must.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.