aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common/src
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2018-07-05 11:51:17 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-17 20:21:27 +0200
commit8cfc544c1fb69e783c58d74ad3083a686c25f07a (patch)
tree141f98fc11a18e92e09a97233cc2a1620fcda0b0 /server/sonar-server-common/src
parent8bbe57990ec82e2419925b13b90a1e0869d09512 (diff)
downloadsonarqube-8cfc544c1fb69e783c58d74ad3083a686c25f07a.tar.gz
sonarqube-8cfc544c1fb69e783c58d74ad3083a686c25f07a.zip
SONAR-10541, SONAR-10331 Drop compatibility mode and clean plugin classloader
Diffstat (limited to 'server/sonar-server-common/src')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java b/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
index 9818d98584f..d596044e8e3 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/platform/ServerFileSystemImpl.java
@@ -20,6 +20,8 @@
package org.sonar.server.platform;
import java.io.File;
+import java.io.IOException;
+import org.apache.commons.io.FileUtils;
import org.picocontainer.Startable;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.log.Logger;
@@ -39,9 +41,9 @@ public class ServerFileSystemImpl implements ServerFileSystem, org.sonar.api.pla
private final File uninstallDir;
public ServerFileSystemImpl(Configuration config) {
- this.homeDir = new File(config.get(PATH_HOME.getKey()).get());
- this.tempDir = new File(config.get(PATH_TEMP.getKey()).get());
- File dataDir = new File(config.get(PATH_DATA.getKey()).get());
+ this.homeDir = createDir(new File(config.get(PATH_HOME.getKey()).get()));
+ this.tempDir = createDir(new File(config.get(PATH_TEMP.getKey()).get()));
+ File dataDir = createDir(new File(config.get(PATH_DATA.getKey()).get()));
this.deployDir = new File(dataDir, "web/deploy");
this.uninstallDir = new File(getTempDir(), "uninstalled-plugins");
}
@@ -91,4 +93,12 @@ public class ServerFileSystemImpl implements ServerFileSystem, org.sonar.api.pla
return uninstallDir;
}
+ private static File createDir(File dir) {
+ try {
+ FileUtils.forceMkdir(dir);
+ return dir;
+ } catch (IOException e) {
+ throw new IllegalStateException("Fail to create directory " + dir, e);
+ }
+ }
}