Refactor #5580: Make isDirectoryExist support relative path