public class TreeDeleter extends Object implements FileVisitor<Path>
FileVisitor
that deletes a file tree.Constructor and Description |
---|
TreeDeleter() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteDir(Path source)
Deeply deletes the directory given by
source . |
FileVisitResult |
postVisitDirectory(Path dir,
IOException exception) |
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attributes) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attributes) |
FileVisitResult |
visitFileFailed(Path file,
IOException exception) |
public static void deleteDir(Path source) throws IOException
source
.source
- The source directory.IOException
public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException
visitFile
in interface FileVisitor<Path>
IOException
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
IOException
public FileVisitResult postVisitDirectory(Path dir, IOException exception) throws IOException
postVisitDirectory
in interface FileVisitor<Path>
IOException
public FileVisitResult visitFileFailed(Path file, IOException exception)
visitFileFailed
in interface FileVisitor<Path>
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.