Package org.silverpeas.core.util.file
Class DeletingPathVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<Path>
-
- org.silverpeas.core.util.file.DeletingPathVisitor
-
- All Implemented Interfaces:
FileVisitor<Path>
public class DeletingPathVisitor extends SimpleFileVisitor<Path>
Visitor that allows to delete quietly (no exceptions) the root path and its content.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description DeletingPathVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
deleteQuietly(Path path)
Deletes quietly (no exceptions)FileVisitResult
postVisitDirectory(Path dir, IOException exc)
FileVisitResult
visitFile(Path file, BasicFileAttributes attrs)
-
Methods inherited from class java.nio.file.SimpleFileVisitor
preVisitDirectory, visitFileFailed
-
-
-
-
Method Detail
-
deleteQuietly
public static boolean deleteQuietly(Path path)
Deletes quietly (no exceptions)- Parameters:
path
- the root path to delete.- Returns:
- boolean that indicates an effective deletion.
-
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
-
-