From d7a1e09227716e47223245ea0d60522b8661ec91 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Wed, 28 Sep 2016 11:47:27 +0200 Subject: fixing quality flaws (mostly Java NIO slow methods usage) --- .../src/main/java/org/sonar/application/AppFileSystem.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sonar-application') diff --git a/sonar-application/src/main/java/org/sonar/application/AppFileSystem.java b/sonar-application/src/main/java/org/sonar/application/AppFileSystem.java index 01c19276757..da9f75affac 100644 --- a/sonar-application/src/main/java/org/sonar/application/AppFileSystem.java +++ b/sonar-application/src/main/java/org/sonar/application/AppFileSystem.java @@ -145,13 +145,14 @@ public class AppFileSystem implements FileSystem { } @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (Files.isDirectory(file)) { - deleteDirectory(file.toFile()); - } else if (file.getFileName().equals(SHAREDMEMORY_FILE)) { + public FileVisitResult visitFile(Path filePath, BasicFileAttributes attrs) throws IOException { + File file = filePath.toFile(); + if (file.isDirectory()) { + deleteDirectory(file); + } else if (filePath.getFileName().equals(SHAREDMEMORY_FILE)) { return CONTINUE; - } else if (!symLink || !file.equals(path)) { - Files.delete(file); + } else if (!symLink || !filePath.equals(path)) { + Files.delete(filePath); } return CONTINUE; } -- cgit v1.2.3