aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-07-28 15:33:43 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-08-25 16:54:31 +0200
commit8eceec4c11715b83faf6a7bff745b3f5e383fd11 (patch)
tree88dfd1b8626269fdf1f9c1b74adc87a16f820a7d /server/sonar-server
parentcbf0b7bdaa96aa15cdccb58fd8067cbc809c8e0b (diff)
downloadsonarqube-8eceec4c11715b83faf6a7bff745b3f5e383fd11.tar.gz
sonarqube-8eceec4c11715b83faf6a7bff745b3f5e383fd11.zip
SONAR-5417 Load project referentials using WS
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/TempFolderProvider.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/TempFolderProvider.java b/server/sonar-server/src/main/java/org/sonar/server/platform/TempFolderProvider.java
index 981bfb8d606..21aabdb9729 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/TempFolderProvider.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/TempFolderProvider.java
@@ -30,14 +30,19 @@ import java.io.IOException;
public class TempFolderProvider extends ProviderAdapter {
+ private TempFolder tempFolder;
+
public TempFolder provide(ServerFileSystem fs) {
- File tempDir = new File(fs.getTempDir(), "tmp");
- try {
- FileUtils.forceMkdir(tempDir);
- } catch (IOException e) {
- throw new IllegalStateException("Unable to create root temp directory " + tempDir, e);
+ if (tempFolder == null) {
+ File tempDir = new File(fs.getTempDir(), "tmp");
+ try {
+ FileUtils.forceMkdir(tempDir);
+ } catch (IOException e) {
+ throw new IllegalStateException("Unable to create root temp directory " + tempDir, e);
+ }
+ tempFolder = new DefaultTempFolder(tempDir);
}
- return new DefaultTempFolder(tempDir);
+ return tempFolder;
}
}