Package org.spongepowered.api.util.file
Class DeleteFileVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<java.nio.file.Path>
-
- org.spongepowered.api.util.file.DeleteFileVisitor
-
- All Implemented Interfaces:
java.nio.file.FileVisitor<java.nio.file.Path>
public class DeleteFileVisitor extends java.nio.file.SimpleFileVisitor<java.nio.file.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 java.nio.file.FileVisitResult
postVisitDirectory(java.nio.file.Path dir, java.io.IOException exc)
java.nio.file.FileVisitResult
visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs)
-
-
-
Field Detail
-
INSTANCE
public static final DeleteFileVisitor INSTANCE
-
-
Method Detail
-
visitFile
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
- Specified by:
visitFile
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
visitFile
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
postVisitDirectory
public java.nio.file.FileVisitResult postVisitDirectory(java.nio.file.Path dir, java.io.IOException exc) throws java.io.IOException
- Specified by:
postVisitDirectory
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
postVisitDirectory
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
-