use of org.apache.hadoop.hdfs.web.oauth2.OAuth2ConnectionConfigurator in project hadoop by apache.
the class URLConnectionFactory method newOAuth2URLConnectionFactory.
/**
* Construct a new URLConnectionFactory that supports OAut-based connections.
* It will also try to load the SSL configuration when they are specified.
*/
public static URLConnectionFactory newOAuth2URLConnectionFactory(Configuration conf) throws IOException {
ConnectionConfigurator conn;
try {
ConnectionConfigurator sslConnConfigurator = newSslConnConfigurator(DEFAULT_SOCKET_TIMEOUT, conf);
conn = new OAuth2ConnectionConfigurator(conf, sslConnConfigurator);
} catch (Exception e) {
throw new IOException("Unable to load OAuth2 connection factory.", e);
}
return new URLConnectionFactory(conn);
}
Aggregations