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
That will probably work fine as it is, although I would use getCanonicalPath() rather than getAbsolutePath(). This should normalize any weird paths like x/../y/z which would otherwise screw up the matching.
getCanonicalPath()
getAbsolutePath()
x/../y/z