LOG4J2-435 added method beforeFileTreeWalk for stateful conditions Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a5bb1d2a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a5bb1d2a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a5bb1d2a
Branch: refs/heads/master Commit: a5bb1d2aa88d24444ad71cfffe806a608256acb3 Parents: b7781d6 Author: rpopma <[email protected]> Authored: Thu Nov 26 23:38:24 2015 +0900 Committer: rpopma <[email protected]> Committed: Thu Nov 26 23:38:24 2015 +0900 ---------------------------------------------------------------------- .../log4j/core/appender/rolling/action/PathCondition.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a5bb1d2a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java index ff40dfe..0fa7873 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/PathCondition.java @@ -17,6 +17,7 @@ package org.apache.logging.log4j.core.appender.rolling.action; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; @@ -26,6 +27,12 @@ import java.nio.file.attribute.BasicFileAttributes; public interface PathCondition { /** + * Invoked before a new {@linkplain Files#walkFileTree(Path, java.util.Set, int, java.nio.file.FileVisitor) file + * tree walk} is started. Stateful PathConditions can reset their state when this method is called. + */ + void beforeFileTreeWalk(); + + /** * Returns {@code true} if the specified candidate path should be deleted, {@code false} otherwise. * * @param baseDir the directory from where to start scanning for deletion candidate files
