Package org.apache.commons.io.file
Class CleaningPathVisitor
java.lang.Object
java.nio.file.SimpleFileVisitor<Path>
org.apache.commons.io.file.SimplePathVisitor
org.apache.commons.io.file.CountingPathVisitor
org.apache.commons.io.file.CleaningPathVisitor
- All Implemented Interfaces:
- FileVisitor<Path>,- PathVisitor
Deletes files but not directories as a visit proceeds.
- Since:
- 2.7
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.commons.io.file.CountingPathVisitorCountingPathVisitor.AbstractBuilder<T,B extends CountingPathVisitor.AbstractBuilder<T, B>>, CountingPathVisitor.Builder 
- 
Constructor SummaryConstructorsConstructorDescriptionCleaningPathVisitor(Counters.PathCounters pathCounter, String... skip) Constructs a new instance that deletes files except for the files and directories explicitly given.CleaningPathVisitor(Counters.PathCounters pathCounter, DeleteOption[] deleteOption, String... skip) Constructs a instance that deletes files except for the files and directories explicitly given.
- 
Method SummaryModifier and TypeMethodDescriptionbooleaninthashCode()preVisitDirectory(Path dir, BasicFileAttributes attributes) visitFile(Path file, BasicFileAttributes attributes) static CountingPathVisitorConstructs a new instance configured with a BigIntegerCounters.PathCounters.static CountingPathVisitorConstructs a new instance configured with a longCounters.PathCounters.Methods inherited from class org.apache.commons.io.file.CountingPathVisitoraccept, getPathCounters, postVisitDirectory, toString, updateDirCounter, updateFileCountersMethods inherited from class org.apache.commons.io.file.SimplePathVisitorvisitFileFailed
- 
Constructor Details- 
CleaningPathVisitorpublic CleaningPathVisitor(Counters.PathCounters pathCounter, DeleteOption[] deleteOption, String... skip) Constructs a instance that deletes files except for the files and directories explicitly given.- Parameters:
- pathCounter- How to count visits.
- deleteOption- How deletion is handled.
- skip- The files to skip deleting.
- Since:
- 2.8.0
 
- 
CleaningPathVisitorConstructs a new instance that deletes files except for the files and directories explicitly given.- Parameters:
- pathCounter- How to count visits.
- skip- The files to skip deleting.
 
 
- 
- 
Method Details- 
withBigIntegerCountersConstructs a new instance configured with a BigIntegerCounters.PathCounters.- Returns:
- a new instance configured with a BigInteger Counters.PathCounters.
 
- 
withLongCountersConstructs a new instance configured with a longCounters.PathCounters.- Returns:
- a new instance configured with a long Counters.PathCounters.
 
- 
equals- Overrides:
- equalsin class- CountingPathVisitor
 
- 
hashCode- Overrides:
- hashCodein class- CountingPathVisitor
 
- 
preVisitDirectorypublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException - Specified by:
- preVisitDirectoryin interface- FileVisitor<Path>
- Overrides:
- preVisitDirectoryin class- CountingPathVisitor
- Throws:
- IOException
 
- 
visitFile- Specified by:
- visitFilein interface- FileVisitor<Path>
- Overrides:
- visitFilein class- CountingPathVisitor
- Throws:
- IOException
 
 
-