You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2015/11/26 15:56:03 UTC
[44/50] logging-log4j2 git commit: LOG4J2-435 renamed variables
LOG4J2-435 renamed variables
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4b9b55e0
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4b9b55e0
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4b9b55e0
Branch: refs/heads/LOG4J2-435-delete-on-rollover
Commit: 4b9b55e06e057457721d2999b63afd8f3b5cf10b
Parents: b790041
Author: rpopma <rp...@apache.org>
Authored: Thu Nov 26 23:44:57 2015 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu Nov 26 23:44:57 2015 +0900
----------------------------------------------------------------------
.../core/appender/rolling/action/DeletingVisitor.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4b9b55e0/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
index 75a7bd2..fc42c05 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/DeletingVisitor.java
@@ -36,22 +36,25 @@ public class DeletingVisitor extends SimpleFileVisitor<Path> {
private static final Logger LOGGER = StatusLogger.getLogger();
private final Path basePath;
- private final List<? extends PathCondition> pathFilters;
+ private final List<? extends PathCondition> pathConditions;
/**
* Constructs a new DeletingVisitor.
*
* @param basePath used to relativize paths
- * @param pathFilters objects that need to confirm whether a file can be deleted
+ * @param pathConditions objects that need to confirm whether a file can be deleted
*/
- public DeletingVisitor(final Path basePath, final List<? extends PathCondition> pathFilters) {
+ public DeletingVisitor(final Path basePath, final List<? extends PathCondition> pathConditions) {
this.basePath = Objects.requireNonNull(basePath, "basePath");
- this.pathFilters = Objects.requireNonNull(pathFilters, "filters");
+ this.pathConditions = Objects.requireNonNull(pathConditions, "pathConditions");
+ for (final PathCondition condition : pathConditions) {
+ condition.beforeFileTreeWalk();
+ }
}
@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
- for (final PathCondition pathFilter : pathFilters) {
+ for (final PathCondition pathFilter : pathConditions) {
final Path relative = basePath.relativize(file);
if (!pathFilter.accept(basePath, relative, attrs)) {
LOGGER.trace("Not deleting base={}, relative={}", basePath, relative);