aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-02-22 16:06:34 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-02-22 16:06:34 +0100
commit4dba0ebe17b7e0622b24a2171fb7237889fba3f2 (patch)
tree611f69ca83f2d2773f003ede08881add330a7c6c /sonar-server
parentf91e16c9baea6ec4941a3c0a0be241b1dcd8f62b (diff)
downloadsonarqube-4dba0ebe17b7e0622b24a2171fb7237889fba3f2.tar.gz
sonarqube-4dba0ebe17b7e0622b24a2171fb7237889fba3f2.zip
Update the way to download plugins when url is a file
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java
index 5658de4e291..dfa56028aa3 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDownloader.java
@@ -95,13 +95,12 @@ public class PluginDownloader implements ServerComponent {
private void downloadRelease(Release release) throws URISyntaxException, IOException {
String url = release.getDownloadUrl();
+ URI uri = new URI(url);
if (!url.startsWith("file:")) {
- URI uri = new URI(url);
String filename = StringUtils.substringAfterLast(uri.getPath(), "/");
downloader.download(uri, new File(downloadDir, filename));
} else {
- String filePath = url.replaceFirst("file:", "");
- File file = new File(filePath);
+ File file = FileUtils.toFile(uri.toURL());
FileUtils.copyFileToDirectory(file, downloadDir);
}
}