public abstract class ArchiveBatchFilter extends Object implements Serializable
accept() is given an ArchiveRecord to avoid unnecessary reading and copying of data of records not accepted by filter.
Modifier and Type | Field and Description |
---|---|
static ArchiveBatchFilter |
EXCLUDE_NON_RESPONSE_RECORDS
A default filter: Accepts only response records.
|
static ArchiveBatchFilter |
EXCLUDE_NON_WARCINFO_RECORDS
A default filter: Accepts only response records.
|
protected String |
name
The name of the BatchFilter.
|
static ArchiveBatchFilter |
NO_FILTER
A default filter: Accepts everything.
|
static ArchiveBatchFilter |
ONLY_HTTP_ENTRIES
Filter that only accepts records where the url starts with http.
|
Modifier | Constructor and Description |
---|---|
protected |
ArchiveBatchFilter(String name)
Create a new filter with the given name.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accept(ArchiveRecordBase record)
Check if a given record is accepted (not filtered out) by this filter.
|
static ArchiveBatchFilter |
getMimetypeBatchFilter(String mimetype)
Note that the mimetype of the WARC responserecord is not (necessarily) the same as its payload.
|
protected String |
getName()
Get the name of the filter.
|
static boolean |
mimetypeIsOk(String mimetype)
Check, if a certain mimetype is valid
|
public static final ArchiveBatchFilter NO_FILTER
public static final ArchiveBatchFilter EXCLUDE_NON_RESPONSE_RECORDS
public static final ArchiveBatchFilter EXCLUDE_NON_WARCINFO_RECORDS
public static final ArchiveBatchFilter ONLY_HTTP_ENTRIES
protected ArchiveBatchFilter(String name)
name
- The name of this filter, for debugging mostly.public abstract boolean accept(ArchiveRecordBase record)
record
- a given archive recordpublic static ArchiveBatchFilter getMimetypeBatchFilter(String mimetype) throws MimeTypeParseException
mimetype
- String denoting the mimetype this filter representsMimeTypeParseException
- (if mimetype is invalid)public static boolean mimetypeIsOk(String mimetype)
mimetype
- Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.