public class LastModifiedMetadataChecksummer extends AbstractMetadataChecksummer
Default implementation of IMetadataChecksummer for the
Norconex HTTP Collector which simply
returns the exact value of the "Last-Modified" HTTP header field, or
null if not present.
You have the option to keep the checksum as a document metadata field.
When AbstractMetadataChecksummer.setKeep(boolean) is true, the checksum will be
stored in the target field name specified. If you do not specify any,
it stores it under the metadata field name
CollectorMetadata.COLLECTOR_CHECKSUM_METADATA.
To use different fields (one or several) to constitute a checksum,
you can instead use the GenericMetadataChecksummer.
<metadataChecksummer
class="com.norconex.collector.http.checksum.impl.LastModifiedMetadataChecksummer"
disabled="[false|true]"
keep="[false|true]"
targetField="(field to store checksum)" />
The following will store the last modified date used for checksum purposes in a field called "metaChecksum".
<metadataChecksummer keep="true" targetField="metaChecksum" />
GenericMetadataChecksummer| Constructor and Description |
|---|
LastModifiedMetadataChecksummer() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
doCreateMetaChecksum(Properties metadata) |
boolean |
equals(Object other) |
int |
hashCode() |
boolean |
isDisabled()
Whether this checksummer is disabled or not.
|
protected void |
loadChecksummerFromXML(XMLConfiguration xml) |
protected void |
saveChecksummerToXML(EnhancedXMLStreamWriter writer) |
void |
setDisabled(boolean disabled)
Sets whether this checksummer is disabled or not.
|
String |
toString() |
createMetadataChecksum, getTargetField, isKeep, loadFromXML, saveToXML, setKeep, setTargetFieldprotected String doCreateMetaChecksum(Properties metadata)
doCreateMetaChecksum in class AbstractMetadataChecksummerpublic boolean isDisabled()
null).true if disabledpublic void setDisabled(boolean disabled)
null).disabled - true if disabledprotected void loadChecksummerFromXML(XMLConfiguration xml)
loadChecksummerFromXML in class AbstractMetadataChecksummerprotected void saveChecksummerToXML(EnhancedXMLStreamWriter writer) throws XMLStreamException
saveChecksummerToXML in class AbstractMetadataChecksummerXMLStreamExceptionpublic boolean equals(Object other)
equals in class AbstractMetadataChecksummerpublic int hashCode()
hashCode in class AbstractMetadataChecksummerpublic String toString()
toString in class AbstractMetadataChecksummerCopyright © 2009–2021 Norconex Inc.. All rights reserved.