summaryrefslogtreecommitdiffstats
path: root/sonar-home
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-03-24 11:01:26 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2014-03-24 11:02:19 +0100
commitc95f41167a3d2e30855e4d41a2bde8154ba754be (patch)
treeb5a09010440a203bb09d20c368798d47e7a11b1d /sonar-home
parentc2e0639439e8313272cc620bcb80ad216996d3be (diff)
downloadsonarqube-c95f41167a3d2e30855e4d41a2bde8154ba754be.tar.gz
sonarqube-c95f41167a3d2e30855e4d41a2bde8154ba754be.zip
SONAR-5062 Don't fail when concurrent process unzip same plugin dependency
Diffstat (limited to 'sonar-home')
-rw-r--r--sonar-home/src/main/java/org/sonar/home/cache/FileCache.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java
index 5898f7e4292..4ede4d4f56a 100644
--- a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java
+++ b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java
@@ -19,6 +19,7 @@
*/
package org.sonar.home.cache;
+import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils;
import org.sonar.api.utils.ZipUtils;
import org.sonar.home.log.Log;
@@ -187,7 +188,12 @@ public class FileCache {
if (!destDir.exists()) {
File tempDir = createTempDir();
ZipUtils.unzip(cachedFile, tempDir, new LibFilter());
- FileUtils.moveDirectory(tempDir, destDir);
+ // Recheck in case a concurrent process
+ try {
+ FileUtils.moveDirectory(tempDir, destDir);
+ } catch (FileExistsException e) {
+ // Ignore as is certainly means a concurrent process has unziped the same file
+ }
}
return destDir;
}