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-09-19 10:54:37 +0200
commitfdf0f2f89300342c932ab23b71c895866c7d4834 (patch)
tree2a8be2a4e5bf3d39e59efbef7ceefa192ee76711 /server/sonar-server-common/src
parent4013c04fad08403ec9feaa406eb69f2e9dc6d745 (diff)
downloadsonarqube-fdf0f2f89300342c932ab23b71c895866c7d4834.tar.gz
sonarqube-fdf0f2f89300342c932ab23b71c895866c7d4834.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);
+ }
+ }
}