Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 84126 invoked from network); 6 Jan 2008 00:42:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jan 2008 00:42:58 -0000 Received: (qmail 56721 invoked by uid 500); 6 Jan 2008 00:42:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 56651 invoked by uid 500); 6 Jan 2008 00:42:46 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 56642 invoked by uid 99); 6 Jan 2008 00:42:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jan 2008 16:42:46 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Jan 2008 00:42:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 06792714211 for ; Sat, 5 Jan 2008 16:42:34 -0800 (PST) Message-ID: <7202051.1199580154023.JavaMail.jira@brutus> Date: Sat, 5 Jan 2008 16:42:34 -0800 (PST) From: "Niall Pemberton (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (IO-142) Retrieve Directory File List in Timestamp Order In-Reply-To: <9360125.1196805343066.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556310#action_12556310 ] Niall Pemberton commented on IO-142: ------------------------------------ I have added the Comparator implementations from IO-145: http://svn.apache.org/repos/asf/commons/proper/io/trunk/src/java/org/apache/commons/io/comparator/ So is there anything left to do for this? > Retrieve Directory File List in Timestamp Order > ----------------------------------------------- > > Key: IO-142 > URL: https://issues.apache.org/jira/browse/IO-142 > Project: Commons IO > Issue Type: New Feature > Components: Utilities > Environment: Java SE 5 - Windows, Linux > Reporter: Al Scherer > > I searched your current Commons-IO issues/feature requests and did not find the following so I'd like to propose it as a feature request. > Given a filename filter and dir name, the method would return a List of the files that match the filter in last-modified timestamp order. > Sun explicitly does not provide this functionality - from the Sun Java SE 5 API Javadocs, File's listFiles() method descriptions include the following disclaimer: > "There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order." > I needed the files in last-modified order so I wrote code to do it and would be glad to share the code with the commons project if you feel it would be useful. > The signature is: > - public List getFileListInTimestampOrder(FilenameFilter filter, String dirName) > I've already written, tested and used code to do this. > There are additional flavors that might be worthwhile, too. > - public List getFileListInTimestampOrderReversed(FilenameFilter filter, String dirName) > - public List getFileListInNameOrder(FilenameFilter filter, String dirName) > - public List getFileListInNameOrderReversed(FilenameFilter filter, String dirName) > BTW, I originally posted this on commons-lang but was given feedback that it might be a better fit here. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.