Package org.forgerock.audit.retention
Class TimestampFilenameFilter
- java.lang.Object
-
- org.forgerock.audit.retention.TimestampFilenameFilter
-
- All Implemented Interfaces:
FilenameFilter
,Predicate<Path>
public class TimestampFilenameFilter extends Object implements FilenameFilter, Predicate<Path>
AFilenameFilter
that matches historical log files. TheFilenameFilter
matches a filename with a given prefix, filename and timestamp.
-
-
Constructor Summary
Constructors Constructor Description TimestampFilenameFilter(File initialFile, String prefix, DateTimeFormatter suffixDateFormat)
Constructs aTimestampFilenameFilter
given an initial file, prefix and suffix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File dir, String fileName)
Matches the name of a file to theFilenameFilter
.boolean
test(Path file)
-
-
-
Constructor Detail
-
TimestampFilenameFilter
public TimestampFilenameFilter(File initialFile, String prefix, DateTimeFormatter suffixDateFormat)
Constructs aTimestampFilenameFilter
given an initial file, prefix and suffix.- Parameters:
initialFile
- The initial filename.prefix
- The audit file prefix to match (can benull
).suffixDateFormat
- The audit file date suffix to match.
-
-
Method Detail
-
accept
public boolean accept(File dir, String fileName)
Matches the name of a file to theFilenameFilter
.- Specified by:
accept
in interfaceFilenameFilter
-
-