commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-291) Add new function FileUtils.isContained
Date Sat, 05 Nov 2011 16:44:51 GMT

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

Sebb commented on IO-291:
-------------------------

What is the original use case? 
Maybe knowing that would help inform decisions on whether files and/or directories contain
themselves and whether parameters need to exist or not.

Note that the behaviour of getCanonicalFile() may depend on whether or not the file exists,
from the Javadoc:

{quote}
The canonical form of the pathname of a nonexistent file or directory may be different from
the canonical form of the same pathname after the file or directory is created. Similarly,
the canonical form of the pathname of an existing file or directory may be different from
the canonical form of the same pathname after the file or directory is deleted.
{quote}

I don't like the recursive implementation; also it should not be necessary to call getCanonicalFile()
multiple times.
It's also unsafe to call it multiple times as the representation may potentially change because
of the above.

==
The io-291.diff patch contains tabs, and is an Eclipse workspace-relative patch so is difficult
for anyone else to apply.

Both patches contain @author tags, which we discourage.

                
> Add new function FileUtils.isContained
> --------------------------------------
>
>                 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.1
>
>         Attachments: FileUtils.isContained.patch, io-291.diff
>
>
> 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

        

Mime
View raw message