mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 16:23:37 +01:00
removed nexus auth test code
Former-commit-id: 9b5f8cbceb5a6a273dfd7ba85bf16510dab3ddb5
This commit is contained in:
@@ -200,14 +200,6 @@ public final class Settings {
|
||||
* The properties key for using the proxy to reach Nexus.
|
||||
*/
|
||||
public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy";
|
||||
/**
|
||||
* The properties key for the Nexus user name.
|
||||
*/
|
||||
public static final String ANALYZER_NEXUS_USER = "analyzer.nexus.user";
|
||||
/**
|
||||
* The properties key for the Nexus user's password.
|
||||
*/
|
||||
public static final String ANALYZER_NEXUS_PASSWORD = "analyzer.nexus.password";
|
||||
/**
|
||||
* The properties key for whether the Central analyzer is enabled.
|
||||
*/
|
||||
|
||||
@@ -117,33 +117,4 @@ public final class URLConnectionFactory {
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to create an HttpURLConnection. This version of createHttpURLConnection does not utilize any proxy
|
||||
* configuration; but does provide the ability to authenticate to the site.
|
||||
*
|
||||
* @param url the URL to connect to
|
||||
* @param username the user name for authentication to the given site
|
||||
* @param password the password for authentication to the given site
|
||||
* @return a newly constructed HttpURLConnection
|
||||
* @throws URLConnectionFailureException thrown if there is an exception
|
||||
*/
|
||||
public static HttpURLConnection createHttpURLConnection(URL url, final String username, final char[] password)
|
||||
throws URLConnectionFailureException {
|
||||
HttpURLConnection conn = null;
|
||||
try {
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
final int timeout = Settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 60000);
|
||||
conn.setConnectTimeout(timeout);
|
||||
conn.setInstanceFollowRedirects(true);
|
||||
} catch (IOException ioe) {
|
||||
throw new URLConnectionFailureException("Error getting connection.", ioe);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user