presto-hive/src/main/java/io/prestosql/plugin/hive/util/HiveWriteUtils.java/HiveWriteUtils/isDirectory
class HiveWriteUtils:    private static boolean isDirectory(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path)
    {
        try {
            return hdfsEnvironment.getFileSystem(context, path).isDirectory(path);
        }
        catch (IOException e) {
            throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed checking path: " + path, e);
        }
    }