public static boolean isInSubDirectory ( File dir , File file ) { if ( file == null ) return false ; if ( file . equals ( dir ) ) return true ; return isInSubDirectory ( dir , file . getParentFile ( ) ) ; }
Returns true if file is a subfile or subdirectory of dir .