I am trying to find if given path is possible child of another path using java. Both path may not exist.
Say c:\\Program Files\\My Company\\test\\My App
c:\\Program Files\\My Company\\test\\My App
File parent = maybeChild.getParentFile(); while ( parent != null ) { if ( parent.equals( possibleParent ) ) return true; parent = parent.getParentFile(); } return false;