aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-03 14:02:40 +0000
committerGodin <mandrikov@gmail.com>2010-11-03 14:02:40 +0000
commit55c0003570731e64d7eeba8816bbf17fe04ee134 (patch)
treebe7c786914cb4536943c3ed38db32bc1c48129de /sonar-server
parentc65fc45126f505d9373ad00c5b728bfb4744812e (diff)
downloadsonarqube-55c0003570731e64d7eeba8816bbf17fe04ee134.tar.gz
sonarqube-55c0003570731e64d7eeba8816bbf17fe04ee134.zip
Fix installation for deprecated plugins
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
index e07c1519f56..38030582443 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
@@ -19,15 +19,6 @@
*/
package org.sonar.server.plugins;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
@@ -48,6 +39,15 @@ import org.sonar.updatecenter.common.PluginKeyUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
public final class PluginDeployer implements ServerComponent {
private static final Logger LOG = LoggerFactory.getLogger(PluginDeployer.class);
@@ -224,7 +224,9 @@ public final class PluginDeployer implements ServerComponent {
Collection<File> jars = FileUtils.listFiles(fileSystem.getDownloadedPluginsDir(), new String[] { "jar" }, false);
for (File jar : jars) {
File movedJar = moveDownloadedFile(jar);
- registerPluginMetadata(movedJar, false, true);
+ if (movedJar != null) {
+ registerPluginMetadata(movedJar, false, true);
+ }
}
}
}
@@ -235,11 +237,11 @@ public final class PluginDeployer implements ServerComponent {
if (destFile.exists()) {
// plugin with same filename already installed
FileUtils.deleteQuietly(jar);
- return destFile;
+ return null;
}
try {
FileUtils.moveFileToDirectory(jar, destDir, true);
- return new File(destDir, jar.getName());
+ return destFile;
} catch (IOException e) {
LOG.error("Fail to move the downloaded file: " + jar.getAbsolutePath(), e);