Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B510EC3F for ; Wed, 30 Jan 2013 19:07:17 +0000 (UTC) Received: (qmail 22351 invoked by uid 500); 30 Jan 2013 19:07:15 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 22279 invoked by uid 500); 30 Jan 2013 19:07:15 -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 22241 invoked by uid 99); 30 Jan 2013 19:07:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2013 19:07:15 +0000 Date: Wed, 30 Jan 2013 19:07:15 +0000 (UTC) From: =?utf-8?Q?Ondra_=C5=BDi=C5=BEka_=28JIRA=29?= To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IO-364) Allow DirectoryWalker provide relative paths in handle*() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-364?page=3Dcom.atlassian.jir= a.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13566784= #comment-13566784 ]=20 Ondra =C5=BDi=C5=BEka commented on IO-364: -------------------------------- Workaround: {code} new DirectoryWalker( null, new SuffixFileFilter(".texy"), -1){ File dirToScan; @Override protected void handleFile( File file, int depth, Coll= ection results ) throws IOException { String rel =3D dirToScan.toURI().relativize(file.toURI()).g= etPath(); File relativePath =3D new File(rel); addDocToIndexIfNotExists( relativePath ); } public void scan( File dirToScan ) throws IOException { List results =3D new ArrayList(); this.dirToScan =3D dirToScan; walk( dirToScan, results ); } }.scan( dirToScan ); {code} =20 > Allow DirectoryWalker provide relative paths in handle*() > --------------------------------------------------------- > > Key: IO-364 > URL: https://issues.apache.org/jira/browse/IO-364 > Project: Commons IO > Issue Type: Bug > Components: Utilities > Affects Versions: 2.4 > Reporter: Ondra =C5=BDi=C5=BEka > > {code} > handleFile( File file, int depth, Collection results ) > {code} > and other methods provide a file object with full path. > As it's much easier to concat base path and additional path than "substra= cting" one path from other, I suggest: > The `File` object provided by `handleFile()` and other `handle*` methods = should (optionally) contain path relative to the one passed to `walk()`. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira