You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2009/01/22 02:14:03 UTC

[jira] Commented: (IO-184) FileUtils.isAncestor

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

Jukka Zitting commented on IO-184:
----------------------------------

What about symlinked paths?

> FileUtils.isAncestor
> --------------------
>
>                 Key: IO-184
>                 URL: https://issues.apache.org/jira/browse/IO-184
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>            Reporter: Yu Kobayashi
>            Priority: Minor
>             Fix For: 2.x
>
>
> Please add FileUtils.isAncestor(). Code is following.
> public static boolean isAncestor(File file, File ancestor) {
> 	File f = file;
> 	while (f != null) {
> 		if (f.equals(ancestor)) return true;
> 		f = f.getParentFile();
> 	}
> 	return false;
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.