Package org.esa.snap.core.util.io
Class TreeDeleter
- java.lang.Object
-
- org.esa.snap.core.util.io.TreeDeleter
-
- All Implemented Interfaces:
FileVisitor<Path>
public class TreeDeleter extends Object implements FileVisitor<Path>
AFileVisitor
that deletes a file tree.
-
-
Constructor Summary
Constructors Constructor Description TreeDeleter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
deleteDir(Path source)
Deeply deletes the directory given bysource
.FileVisitResult
postVisitDirectory(Path dir, IOException exception)
FileVisitResult
preVisitDirectory(Path dir, BasicFileAttributes attributes)
FileVisitResult
visitFile(Path file, BasicFileAttributes attributes)
FileVisitResult
visitFileFailed(Path file, IOException exception)
-
-
-
Method Detail
-
deleteDir
public static void deleteDir(Path source) throws IOException
Deeply deletes the directory given bysource
.- Parameters:
source
- The source directory.- Throws:
IOException
-
visitFile
public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException
- Specified by:
visitFile
in interfaceFileVisitor<Path>
- Throws:
IOException
-
preVisitDirectory
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException
- Specified by:
preVisitDirectory
in interfaceFileVisitor<Path>
- Throws:
IOException
-
postVisitDirectory
public FileVisitResult postVisitDirectory(Path dir, IOException exception) throws IOException
- Specified by:
postVisitDirectory
in interfaceFileVisitor<Path>
- Throws:
IOException
-
visitFileFailed
public FileVisitResult visitFileFailed(Path file, IOException exception)
- Specified by:
visitFileFailed
in interfaceFileVisitor<Path>
-
-