Class RemoteUriValidator

java.lang.Object
org.apache.gravitino.utils.RemoteUriValidator

public final class RemoteUriValidator extends Object
Validates remote URI hosts before server-side downloads.
  • Method Details

    • validate

      public static void validate(URI uri, boolean blockUnsafeAddress, String blockUnsafeAddressHint) throws IOException
      Resolves the host in the given URI and rejects unsafe addresses when blocking is enabled.
      Parameters:
      uri - The remote URI to validate.
      blockUnsafeAddress - Whether unsafe addresses should be blocked.
      blockUnsafeAddressHint - The configuration hint that disables unsafe address blocking.
      Throws:
      IOException - If host resolution fails.
      IllegalArgumentException - If the URI has no host or resolves to an unsafe address.