Package org.spongepowered.api.util.file
Class DeleteFileVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<Path>
-
- org.spongepowered.api.util.file.DeleteFileVisitor
-
- All Implemented Interfaces:
FileVisitor<Path>
public class DeleteFileVisitor extends SimpleFileVisitor<Path>
Represents aFileVisitor
which will recursively delete a directory with all its contents.Example usage:
Files.walkFileTree(dir, DeleteFileVisitor.INSTANCE);
-
-
Field Summary
Fields Modifier and Type Field Description static DeleteFileVisitor
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protected
DeleteFileVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileVisitResult
postVisitDirectory(Path dir, IOException exc)
FileVisitResult
visitFile(Path file, BasicFileAttributes attrs)
-
Methods inherited from class java.nio.file.SimpleFileVisitor
preVisitDirectory, visitFileFailed
-
-
-
-
Field Detail
-
INSTANCE
public static final DeleteFileVisitor INSTANCE
-
-
Method Detail
-
visitFile
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
- Specified by:
visitFile
in interfaceFileVisitor<Path>
- Overrides:
visitFile
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
postVisitDirectory
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException
- Specified by:
postVisitDirectory
in interfaceFileVisitor<Path>
- Overrides:
postVisitDirectory
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
-