Class IfLastModified
java.lang.Object
org.apache.logging.log4j.core.appender.rolling.action.IfLastModified
- All Implemented Interfaces:
PathCondition
@Plugin(name="IfLastModified",
category="Core",
printObject=true)
public final class IfLastModified
extends Object
implements PathCondition
PathCondition that accepts paths that are older than the specified duration.
- Since:
- 2.5
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.apache.logging.log4j.core.appender.rolling.action.PathCondition
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(Path basePath, Path relativePath, BasicFileAttributes attrs) Returnstrueif the specified candidate path should be deleted,falseotherwise.voidInvoked before a new file tree walk is started.static IfLastModifiedcreateAgeCondition(Duration age, PathCondition... pathConditions) Deprecated.getAge()Deprecated.since 2.24.0.static IfLastModified.BuildertoString()
-
Method Details
-
getAge
Deprecated.since 2.24.0. In 3.0.0 the signature will change. -
getNestedConditions
-
accept
Description copied from interface:PathConditionReturnstrueif the specified candidate path should be deleted,falseotherwise.- Specified by:
acceptin interfacePathCondition- Parameters:
basePath- the directory from where to start scanning for deletion candidate filesrelativePath- the candidate for deletion. This path is relative to the baseDir.attrs- attributes of the candidate path- Returns:
- whether the candidate path should be deleted
-
beforeFileTreeWalk
public void beforeFileTreeWalk()Description copied from interface:PathConditionInvoked before a new file tree walk is started. Stateful PathConditions can reset their state when this method is called.- Specified by:
beforeFileTreeWalkin interfacePathCondition
-
createAgeCondition
@Deprecated public static IfLastModified createAgeCondition(Duration age, PathCondition... pathConditions) Deprecated.since 2.24.0 usenewBuilder()instead. -
toString
-
newBuilder
- Since:
- 2.24.0
-
newBuilder()instead.