mirror of
https://github.com/apache/sqoop.git
synced 2025-05-06 13:32:37 +08:00
SQOOP-2452: Sqoop2: Findbugs: Convert anonymous class in ResourceRequest to static inner class
(Jarek Jarcec Cecho via Abraham Elmahrek)
This commit is contained in:
parent
51fe7a9bc1
commit
3c88f553de
@ -183,6 +183,13 @@ public String delete(String url) {
|
||||
return doHttpRequest(url, HttpMethod.DELETE);
|
||||
}
|
||||
|
||||
private static class SimpleConnectionConfigurator implements ConnectionConfigurator {
|
||||
@Override
|
||||
public HttpURLConnection configure(HttpURLConnection conn) throws IOException {
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
|
||||
public Token<?>[] addDelegationTokens(String strURL, String renewer,
|
||||
Credentials credentials) throws IOException {
|
||||
Token<?>[] tokens = null;
|
||||
@ -190,13 +197,7 @@ public Token<?>[] addDelegationTokens(String strURL, String renewer,
|
||||
Token<?> token = credentials.getToken(dtService);
|
||||
if (token == null) {
|
||||
URL url = new URL(strURL);
|
||||
DelegationTokenAuthenticatedURL authUrl =
|
||||
new DelegationTokenAuthenticatedURL(new ConnectionConfigurator() {
|
||||
@Override
|
||||
public HttpURLConnection configure(HttpURLConnection conn) throws IOException {
|
||||
return conn;
|
||||
}
|
||||
});
|
||||
DelegationTokenAuthenticatedURL authUrl = new DelegationTokenAuthenticatedURL(new SimpleConnectionConfigurator());
|
||||
try {
|
||||
token = authUrl.getDelegationToken(url, authToken, renewer);
|
||||
if (token != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user