public class FileCleaner extends Object implements FileVisitor<Path>
FileVisitor
that will remove all files and directories, except the files in the given fileSet
.Constructor and Description |
---|
FileCleaner(Set<File> fileSet) |
Modifier and Type | Method and Description |
---|---|
int |
getDeletedDirectoryCount() |
int |
getDeletedFileCount() |
FileVisitResult |
postVisitDirectory(Path dir,
IOException exc) |
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attrs) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attrs) |
FileVisitResult |
visitFileFailed(Path file,
IOException exc) |
public int getDeletedFileCount()
public int getDeletedDirectoryCount()
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
IOException
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
visitFile
in interface FileVisitor<Path>
IOException
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException
visitFileFailed
in interface FileVisitor<Path>
IOException
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException
postVisitDirectory
in interface FileVisitor<Path>
IOException
Copyright © 2017. All rights reserved.