Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 43514 invoked from network); 4 Dec 2008 00:26:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 00:26:36 -0000 Received: (qmail 1717 invoked by uid 500); 4 Dec 2008 00:26:47 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 1632 invoked by uid 500); 4 Dec 2008 00:26: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 1621 invoked by uid 99); 4 Dec 2008 00:26:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2008 16:26:46 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 00:25:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 56AD0234C2A3 for ; Wed, 3 Dec 2008 16:25:44 -0800 (PST) Message-ID: <1797206851.1228350344353.JavaMail.jira@brutus> Date: Wed, 3 Dec 2008 16:25:44 -0800 (PST) From: "Niall Pemberton (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (IO-173) FileUtils.listFiles() doesn't return directories In-Reply-To: <787298622.1212751365083.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IO-173?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated IO-173: ------------------------------- Fix Version/s: 2.x > FileUtils.listFiles() doesn't return directories > ------------------------------------------------ > > Key: IO-173 > URL: https://issues.apache.org/jira/browse/IO-173 > Project: Commons IO > Issue Type: Improvement > Components: Utilities > Affects Versions: 1.4 > Reporter: Fran=C3=A7ois Loison > Fix For: 2.x > > > FileUtils.listFiles() returns only files and not directories. > So it can't be used to retrieve sub-directories. > Some fix could be applied: > private static void innerListFiles(Collection files, File directory, > IOFileFilter filter) { > File[] found =3D directory.listFiles((FileFilter) filter); > if (found !=3D null) { > for (int i =3D 0; i < found.length; i++) { > if (found[i].isDirectory()) { > >>> fix > if ( addDirectories ) { > files.add(found[i]); > } > >>> end fix > innerListFiles(files, found[i], filter); > } else { > files.add(found[i]); > } > } > } > } --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.