equal
deleted
inserted
replaced
207 if (root.isDirectory) { |
207 if (root.isDirectory) { |
208 Files.walkFileTree(root.toPath, |
208 Files.walkFileTree(root.toPath, |
209 new SimpleFileVisitor[JPath] { |
209 new SimpleFileVisitor[JPath] { |
210 override def visitFile(file: JPath, attrs: BasicFileAttributes): FileVisitResult = |
210 override def visitFile(file: JPath, attrs: BasicFileAttributes): FileVisitResult = |
211 { |
211 { |
212 Files.delete(file) |
212 Files.deleteIfExists(file) |
213 FileVisitResult.CONTINUE |
213 FileVisitResult.CONTINUE |
214 } |
214 } |
215 |
215 |
216 override def postVisitDirectory(dir: JPath, e: IOException): FileVisitResult = |
216 override def postVisitDirectory(dir: JPath, e: IOException): FileVisitResult = |
217 { |
217 { |
218 if (e == null) { |
218 if (e == null) { |
219 Files.delete(dir) |
219 Files.deleteIfExists(dir) |
220 FileVisitResult.CONTINUE |
220 FileVisitResult.CONTINUE |
221 } |
221 } |
222 else throw e |
222 else throw e |
223 } |
223 } |
224 } |
224 } |