Rewritten isRequestedFileInPath() to prevent excessive tree traversal.