@LimitedPrivate("HDFS")
@Unstable
public class URLConnectionFactory
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_SOCKET_TIMEOUT |
Timeout for socket connects and reads
|
static URLConnectionFactory |
DEFAULT_SYSTEM_CONNECTION_FACTORY |
The URLConnectionFactory that sets the default timeout and it only trusts
Java's SSL certificates.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
destroy() |
|
static URLConnectionFactory |
newDefaultURLConnectionFactory(int connectTimeout,
int readTimeout,
org.apache.hadoop.conf.Configuration conf) |
Construct a new URLConnectionFactory based on the configuration.
|
static URLConnectionFactory |
newDefaultURLConnectionFactory(org.apache.hadoop.conf.Configuration conf) |
Construct a new URLConnectionFactory based on the configuration.
|
static URLConnectionFactory |
newOAuth2URLConnectionFactory(int connectTimeout,
int readTimeout,
org.apache.hadoop.conf.Configuration conf) |
Construct a new URLConnectionFactory that supports OAut-based connections.
|
java.net.URLConnection |
openConnection(java.net.URL url) |
Opens a url with read and connect timeouts
|
java.net.URLConnection |
openConnection(java.net.URL url,
boolean isSpnego) |
Opens a url with read and connect timeouts
|
public static final int DEFAULT_SOCKET_TIMEOUT
public static final URLConnectionFactory DEFAULT_SYSTEM_CONNECTION_FACTORY
public static URLConnectionFactory newDefaultURLConnectionFactory(org.apache.hadoop.conf.Configuration conf)
public static URLConnectionFactory newDefaultURLConnectionFactory(int connectTimeout, int readTimeout, org.apache.hadoop.conf.Configuration conf)
public static URLConnectionFactory newOAuth2URLConnectionFactory(int connectTimeout, int readTimeout, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
java.io.IOExceptionpublic java.net.URLConnection openConnection(java.net.URL url)
throws java.io.IOException
url - to openjava.io.IOExceptionpublic java.net.URLConnection openConnection(java.net.URL url,
boolean isSpnego)
throws java.io.IOException,
org.apache.hadoop.security.authentication.client.AuthenticationException
url - URL to openisSpnego - whether the url should be authenticated via SPNEGOjava.io.IOExceptionorg.apache.hadoop.security.authentication.client.AuthenticationExceptionpublic void destroy()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.