src/Pure/System/isabelle_system.scala
changeset 65090 fc8bb68a7439
parent 65083 9a0e34edfad1
child 65717 556c34fd0554
equal deleted inserted replaced
65089:1d219d76873b 65090:fc8bb68a7439
   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         }