aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-10-05 21:57:38 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-10-05 21:57:38 +0200
commit5e0b742ac8299c7ddcd2bf3dfe682482c4d8eda4 (patch)
tree104b9e7e6bfdb06d5e0ce596ff4f17b5cb662d0d /sonar-scanner-engine
parenta84c614058dead7b5ed9024965e88c8b08195912 (diff)
downloadsonarqube-5e0b742ac8299c7ddcd2bf3dfe682482c4d8eda4.tar.gz
sonarqube-5e0b742ac8299c7ddcd2bf3dfe682482c4d8eda4.zip
Fix Quality flaws
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectLock.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java
index 7795ee44d4b..a131a0123c7 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalTempFolderProvider.java
@@ -109,7 +109,7 @@ public class GlobalTempFolderProvider extends ProviderAdapter implements Compone
}
private static void cleanTempFolders(Path path) throws IOException {
- if (Files.exists(path)) {
+ if (path.toFile().exists()) {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(path, new CleanFilter())) {
for (Path p : stream) {
deleteQuietly(p.toFile());
@@ -121,7 +121,7 @@ public class GlobalTempFolderProvider extends ProviderAdapter implements Compone
private static class CleanFilter implements DirectoryStream.Filter<Path> {
@Override
public boolean accept(Path path) throws IOException {
- if (!Files.isDirectory(path)) {
+ if (!path.toFile().exists()) {
return false;
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectLock.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectLock.java
index 757886ddc94..f7c12bb4930 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectLock.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectLock.java
@@ -35,7 +35,7 @@ public class ProjectLock implements Startable {
public ProjectLock(ProjectReactor projectReactor) {
Path directory = projectReactor.getRoot().getWorkDir().toPath();
try {
- if (!Files.exists(directory)) {
+ if (!directory.toFile().exists()) {
Files.createDirectories(directory);
}
} catch (IOException e) {
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
index 1640ce17ff0..4153cbf681a 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/WorkDirectoryCleaner.java
@@ -37,7 +37,7 @@ public class WorkDirectoryCleaner {
}
public void execute() {
- if (!Files.exists(workDir)) {
+ if (!workDir.toFile().exists()) {
return;
}