Package org.jeasy.batch.core.filter
Class FileExtensionFilter
- java.lang.Object
-
- org.jeasy.batch.core.filter.FileExtensionFilter
-
- All Implemented Interfaces:
RecordFilter<java.nio.file.Path>
,RecordProcessor<java.nio.file.Path,java.nio.file.Path>
public class FileExtensionFilter extends java.lang.Object implements RecordFilter<java.nio.file.Path>
FilterFileRecord
having a payload file name ending with a given extension.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
Constructor Summary
Constructors Constructor Description FileExtensionFilter(java.lang.String... extensions)
Create a newFileExtensionFilter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Record<java.nio.file.Path>
processRecord(Record<java.nio.file.Path> record)
Filter a record.
-
-
-
Constructor Detail
-
FileExtensionFilter
public FileExtensionFilter(java.lang.String... extensions)
Create a newFileExtensionFilter
.- Parameters:
extensions
- a list of extensions. Example: .log
-
-
Method Detail
-
processRecord
public Record<java.nio.file.Path> processRecord(Record<java.nio.file.Path> record)
Description copied from interface:RecordFilter
Filter a record.- Specified by:
processRecord
in interfaceRecordFilter<java.nio.file.Path>
- Specified by:
processRecord
in interfaceRecordProcessor<java.nio.file.Path,java.nio.file.Path>
- Parameters:
record
- the record to filter.- Returns:
- the input record if it should continue in the pipeline or
null
if the record should be filtered
-
-