You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niall Pemberton (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2012/01/07 03:51:39 UTC

[jira] [Issue Comment Edited] (IO-291) Add new function FileUtils.directoryContains

    [ https://issues.apache.org/jira/browse/IO-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181787#comment-13181787 ] 

Niall Pemberton edited comment on IO-291 at 1/7/12 2:50 AM:
------------------------------------------------------------

Also the *meat* of the method seems more suited to FilenameUtils:

{code}
// Canonicalize paths (normalizes relative paths)
String canonicalParent = directory.getCanonicalPath();
String canonicalChild = child.getCanonicalPath();

if (IOCase.SYSTEM.checkEquals(canonicalParent, canonicalChild)) {
    return false;
}

return IOCase.SYSTEM.checkStartsWith(canonicalChild, canonicalParent);
{code}
                
      was (Author: niallp):
    Also the *meat* of the method seems more suited to FilenameUtils:

{{
// Canonicalize paths (normalizes relative paths)
String canonicalParent = directory.getCanonicalPath();
String canonicalChild = child.getCanonicalPath();

if (IOCase.SYSTEM.checkEquals(canonicalParent, canonicalChild)) {
    return false;
}

return IOCase.SYSTEM.checkStartsWith(canonicalChild, canonicalParent);
}}
                  
> Add new function FileUtils.directoryContains
> --------------------------------------------
>
>                 Key: IO-291
>                 URL: https://issues.apache.org/jira/browse/IO-291
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Utilities
>    Affects Versions: 2.1
>            Reporter: Pier-Luc Caron St-Pierre
>            Assignee: Gary D. Gregory
>              Labels: patch
>             Fix For: 2.2
>
>         Attachments: io-291-simple.diff, io-291-v5.patch
>
>
> I added a function that determines whether the specified leaf is contains by the specified composite.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira