iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/authentication/kerberos/FetchFileUtils.java [36:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static void fetchFileFromUri(
      String fileUri, File destFile, int timeout, Configuration conf) throws IOException {
    try {
      URI uri = new URI(fileUri);
      String scheme = Optional.ofNullable(uri.getScheme()).orElse("file");

      switch (scheme) {
        case "http":
        case "https":
        case "ftp":
          FileUtils.copyURLToFile(uri.toURL(), destFile, timeout * 1000, timeout * 1000);
          break;

        case "file":
          Files.createSymbolicLink(destFile.toPath(), new File(uri.getPath()).toPath());
          break;

        case "hdfs":
          FileSystem.get(conf).copyToLocalFile(new Path(uri), new Path(destFile.toURI()));
          break;

        default:
          throw new IllegalArgumentException(
              String.format("Doesn't support the scheme %s", scheme));
      }
    } catch (URISyntaxException ue) {
      throw new IllegalArgumentException("The uri of file has the wrong format", ue);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/authentication/kerberos/FetchFileUtils.java [36:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static void fetchFileFromUri(
      String fileUri, File destFile, int timeout, Configuration conf) throws IOException {
    try {
      URI uri = new URI(fileUri);
      String scheme = Optional.ofNullable(uri.getScheme()).orElse("file");

      switch (scheme) {
        case "http":
        case "https":
        case "ftp":
          FileUtils.copyURLToFile(uri.toURL(), destFile, timeout * 1000, timeout * 1000);
          break;

        case "file":
          Files.createSymbolicLink(destFile.toPath(), new File(uri.getPath()).toPath());
          break;

        case "hdfs":
          FileSystem.get(conf).copyToLocalFile(new Path(uri), new Path(destFile.toURI()));
          break;

        default:
          throw new IllegalArgumentException(
              String.format("Doesn't support the scheme %s", scheme));
      }
    } catch (URISyntaxException ue) {
      throw new IllegalArgumentException("The uri of file has the wrong format", ue);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/FetchFileUtils.java [36:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public static void fetchFileFromUri(
      String fileUri, File destFile, int timeout, Configuration conf) throws IOException {
    try {
      URI uri = new URI(fileUri);
      String scheme = Optional.ofNullable(uri.getScheme()).orElse("file");

      switch (scheme) {
        case "http":
        case "https":
        case "ftp":
          FileUtils.copyURLToFile(uri.toURL(), destFile, timeout * 1000, timeout * 1000);
          break;

        case "file":
          Files.createSymbolicLink(destFile.toPath(), new File(uri.getPath()).toPath());
          break;

        case "hdfs":
          FileSystem.get(conf).copyToLocalFile(new Path(uri), new Path(destFile.toURI()));
          break;

        default:
          throw new IllegalArgumentException(
              String.format("Doesn't support the scheme %s", scheme));
      }
    } catch (URISyntaxException ue) {
      throw new IllegalArgumentException("The uri of file has the wrong format", ue);
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



