Added file adapting feature to getDirectoryPath and getPath.