5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-06 17:20:31 +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:
Abraham Elmahrek 2015-07-29 18:47:09 -07:00
parent 51fe7a9bc1
commit 3c88f553de

View File

@ -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) {