Only make files writable before processing on Windows.
Prior to this was only done on Windows.
This is super slow on mac for libraries with thousands of resources.
RELNOTES: None
@@ -74,13 +74,17 @@ final class ScopedTemporaryDirectory extends SimpleFileVisitor<Path> implements
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
+ if (IS_WINDOWS) {
makeWritable(dir);
+ }
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+ if (IS_WINDOWS) {
makeWritable(file);
+ }
Files.delete(file);
return FileVisitResult.CONTINUE;
}
