summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-14 13:21:31 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-14 13:28:49 +0200
commitbc2f5635cdda458553009460235705e48a394e7f (patch)
tree89c9a12a85c0fd081ece5a2f7aad0320ff9da37e /server
parentce81c9ae7b6fb6748172cf5beb28c55246bacd57 (diff)
downloadsonarqube-bc2f5635cdda458553009460235705e48a394e7f.tar.gz
sonarqube-bc2f5635cdda458553009460235705e48a394e7f.zip
fix quality flaw
Diffstat (limited to 'server')
-rw-r--r--server/sonar-search/src/main/java/org/sonar/search/SearchServer.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
index d93136aad8f..9995ba789d0 100644
--- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
+++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java
@@ -233,24 +233,27 @@ public class SearchServer extends MonitoredProcess {
}
private File esDataDir() {
- if (props.contains(SONAR_PATH_DATA)) {
- return new File(props.of(SONAR_PATH_DATA), "es");
+ String dataDir = props.of(SONAR_PATH_DATA);
+ if (StringUtils.isNotEmpty(dataDir)) {
+ return new File(dataDir, "es");
} else {
return new File(esHomeDir(), "data/es");
}
}
private File esLogDir() {
- if (props.contains(SONAR_PATH_LOG)) {
- return new File(props.of(SONAR_PATH_LOG));
+ String logDir = props.of(SONAR_PATH_LOG);
+ if (StringUtils.isNotEmpty(logDir)) {
+ return new File(logDir);
} else {
return new File(esHomeDir(), "log");
}
}
private File esWorkDir() {
- if (props.contains(SONAR_PATH_TEMP)) {
- return new File(props.of(SONAR_PATH_TEMP));
+ String workDir = props.of(SONAR_PATH_TEMP);
+ if (StringUtils.isNotEmpty(workDir)) {
+ return new File(workDir);
} else {
return new File(esHomeDir(), "temp");
}