diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2013-01-30 10:24:51 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2013-01-30 10:25:47 +0100 |
commit | 9963f42534c2ed037a0c38bb72a3815313e4fb35 (patch) | |
tree | 29a9e5ec1cf72dcc8143dc6b453ef76dd6cdbbe1 /sonar-batch | |
parent | d783de7be0a66c3f0969610d276b3f63dd1a6747 (diff) | |
download | sonarqube-9963f42534c2ed037a0c38bb72a3815313e4fb35.tar.gz sonarqube-9963f42534c2ed037a0c38bb72a3815313e4fb35.zip |
SONAR-2291 Generate a new bootstrap index with md5
to allow caching by Sonar Runner.
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/cache/SonarCache.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/cache/SonarCache.java b/sonar-batch/src/main/java/org/sonar/batch/cache/SonarCache.java index b503dc463df..da4caca7ee3 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/cache/SonarCache.java +++ b/sonar-batch/src/main/java/org/sonar/batch/cache/SonarCache.java @@ -25,7 +25,6 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.sonar.api.utils.SonarException; import java.io.File; import java.io.FileInputStream; @@ -57,11 +56,11 @@ public class SonarCache { this.cacheLocation = cacheLocation; tmpDir = new File(cacheLocation, ".tmp"); if (!cacheLocation.exists()) { - LOG.debug("Creating cache directory: " + cacheLocation.getAbsolutePath()); + LOG.debug("Creating cache directory: {}", cacheLocation.getAbsolutePath()); try { FileUtils.forceMkdir(cacheLocation); } catch (IOException e) { - throw new SonarException("Unable to create cache directory " + cacheLocation.getAbsolutePath(), e); + throw new RuntimeException("Unable to create cache directory " + cacheLocation.getAbsolutePath(), e); } } } @@ -125,7 +124,7 @@ public class SonarCache { if (!rename) { // Check if the file was already in cache if (!finalFileName.exists()) { - LOG.warn("Unable to rename " + tmpFileName.getAbsolutePath() + " to " + finalFileName.getAbsolutePath()); + LOG.warn("Unable to rename {} to {}", tmpFileName.getAbsolutePath(), finalFileName.getAbsolutePath()); LOG.warn("A copy/delete will be tempted but with no garantee of atomicity"); FileUtils.moveFile(tmpFileName, finalFileName); } @@ -183,11 +182,11 @@ public class SonarCache { public File getTmpDir() { if (!tmpDir.exists()) { - LOG.debug("Creating temporary cache directory: " + tmpDir.getAbsolutePath()); + LOG.debug("Creating temporary cache directory: {}", tmpDir.getAbsolutePath()); try { FileUtils.forceMkdir(tmpDir); } catch (IOException e) { - throw new SonarException("Unable to create temporary cache directory " + tmpDir.getAbsolutePath(), e); + throw new RuntimeException("Unable to create temporary cache directory " + tmpDir.getAbsolutePath(), e); } } return tmpDir; |