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 aFileVisitorwhich 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 DeleteFileVisitorINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protectedDeleteFileVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileVisitResultpostVisitDirectory(Path dir, IOException exc)FileVisitResultvisitFile(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:
visitFilein interfaceFileVisitor<Path>- Overrides:
visitFilein classSimpleFileVisitor<Path>- Throws:
IOException
-
postVisitDirectory
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException
- Specified by:
postVisitDirectoryin interfaceFileVisitor<Path>- Overrides:
postVisitDirectoryin classSimpleFileVisitor<Path>- Throws:
IOException
-
-