summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-12-21 23:34:06 +0000
committerGodin <mandrikov@gmail.com>2010-12-21 23:34:06 +0000
commitffe7e443d23ccb8807168d0d1ae7df0633abe388 (patch)
treeba7045ff3dfb1ffeea8be9b7090c5f01fe902ada /sonar-plugin-api
parent6065020e5dadd6a6f785518ae56fc8f5040638c6 (diff)
downloadsonarqube-ffe7e443d23ccb8807168d0d1ae7df0633abe388.tar.gz
sonarqube-ffe7e443d23ccb8807168d0d1ae7df0633abe388.zip
Minor fix
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
index c1c3bebf016..71ea6f72ff6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
@@ -39,13 +39,13 @@ import java.util.List;
/**
* This component downloads HTTP files
- *
+ *
* @since 2.2
*/
public class HttpDownloader implements BatchComponent, ServerComponent {
public static final int TIMEOUT_MILLISECONDS = 20 * 1000;
-
+
private String userAgent;
public HttpDownloader(Server server, Configuration configuration) {
@@ -101,7 +101,8 @@ public class HttpDownloader implements BatchComponent, ServerComponent {
}
private void registerProxyCredentials(Configuration configuration) {
- Authenticator.setDefault(new ProxyAuthenticator(configuration.getString("http.proxyUser"), configuration.getString("http.proxyPassword")));
+ Authenticator.setDefault(new ProxyAuthenticator(configuration.getString("http.proxyUser"), configuration
+ .getString("http.proxyPassword")));
}
private boolean requiresProxyAuthentication(Configuration configuration) {
@@ -135,7 +136,7 @@ public class HttpDownloader implements BatchComponent, ServerComponent {
} catch (Exception e) {
IOUtils.closeQuietly(output);
FileUtils.deleteQuietly(toFile);
- throw new SonarException("Fail to download the file: " + uri + getProxySynthesis(uri), e);
+ throw new SonarException("Fail to download the file: " + uri + " (" + getProxySynthesis(uri) + ")", e);
} finally {
IOUtils.closeQuietly(input);
@@ -151,7 +152,7 @@ public class HttpDownloader implements BatchComponent, ServerComponent {
return IOUtils.toByteArray(input);
} catch (Exception e) {
- throw new SonarException("Fail to download the file: " + uri + getProxySynthesis(uri), e);
+ throw new SonarException("Fail to download the file: " + uri + " (" + getProxySynthesis(uri) + ")", e);
} finally {
IOUtils.closeQuietly(input);
@@ -164,12 +165,12 @@ public class HttpDownloader implements BatchComponent, ServerComponent {
return connection.getInputStream();
} catch (Exception e) {
- throw new SonarException("Fail to download the file: " + uri + getProxySynthesis(uri), e);
+ throw new SonarException("Fail to download the file: " + uri + " (" + getProxySynthesis(uri) + ")", e);
}
}
private HttpURLConnection newHttpConnection(URI uri) throws IOException {
- LoggerFactory.getLogger(getClass()).info("Download: " + uri + getProxySynthesis(uri));
+ LoggerFactory.getLogger(getClass()).info("Download: " + uri + " (" + getProxySynthesis(uri) + ")");
HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
connection.setConnectTimeout(TIMEOUT_MILLISECONDS);
connection.setReadTimeout(TIMEOUT_MILLISECONDS);