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 D3F60176D0 for ; Tue, 23 Jun 2015 06:03:00 +0000 (UTC) Received: (qmail 70830 invoked by uid 500); 23 Jun 2015 06:03:00 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 70722 invoked by uid 500); 23 Jun 2015 06:03:00 -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 70710 invoked by uid 99); 23 Jun 2015 06:03:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jun 2015 06:03:00 +0000 Date: Tue, 23 Jun 2015 06:03:00 +0000 (UTC) From: "Kristian Rosenvold (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (IO-466) FileUtils.directoryContains returns wrong response due to startsWith comparison MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kristian Rosenvold closed IO-466. --------------------------------- Resolution: Duplicate Assignee: Kristian Rosenvold > FileUtils.directoryContains returns wrong response due to startsWith comparison > ------------------------------------------------------------------------------- > > Key: IO-466 > URL: https://issues.apache.org/jira/browse/IO-466 > Project: Commons IO > Issue Type: Bug > Components: Utilities > Affects Versions: 2.4 > Reporter: Ray Navarette > Assignee: Kristian Rosenvold > > Consider the following: > {code:java} > File fooDir = new File("/temp/foo"); > File fooFile = new File("/temp/foo.txt"); > FileUtils.directoryContains(fooDir, fooFile); // returns true, should return false > {code} > fooFile is a sibling of fooDir. fooDir does not contain fooFile. > This is due to the way FilenameUtils.directoryContains is implemented in that this method uses a simple 'startsWith' comparison. A related bug is filed for the FilenameUtils method that I believe should be fixed as well. -- This message was sent by Atlassian JIRA (v6.3.4#6332)