public class FileMetadataChecksummer
extends com.norconex.collector.core.checksum.AbstractMetadataChecksummer
Default implementation of IMetadataChecksummer
which by default
returns the combined values of FileMetadata.COLLECTOR_LASTMODIFIED
and FileMetadata.COLLECTOR_SIZE
, separated with an underscore
(e.g. "14125443181234_123").
To use different fields (one or several) to constitute a checksum,
you can use the GenericMetadataChecksummer
.
Since 2.2.0, this implementation can be disabled in your
configuration by specifying disabled="true"
. When disabled,
the checksum returned is always null
.
<metadataChecksummer class="com.norconex.collector.fs.checksum.impl.FileMetadataChecksummer" disabled="[false|true]" keep="[false|true]" targetField="(field to store checksum)" />
The following will store the generated metadata checksum in a field called "checksum".
<metadataChecksummer class="com.norconex.collector.fs.checksum.impl.FileMetadataChecksummer" keep="true" targetField="checksum" />
GenericMetadataChecksummer
Constructor and Description |
---|
FileMetadataChecksummer() |
Modifier and Type | Method and Description |
---|---|
protected String |
doCreateMetaChecksum(Properties metadata) |
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.
|
protected String doCreateMetaChecksum(Properties metadata)
doCreateMetaChecksum
in class com.norconex.collector.core.checksum.AbstractMetadataChecksummer
public boolean isDisabled()
null
).true
if disabledpublic void setDisabled(boolean disabled)
null
).disabled
- true
if disabledprotected void loadChecksummerFromXML(XMLConfiguration xml)
loadChecksummerFromXML
in class com.norconex.collector.core.checksum.AbstractMetadataChecksummer
protected void saveChecksummerToXML(EnhancedXMLStreamWriter writer) throws XMLStreamException
saveChecksummerToXML
in class com.norconex.collector.core.checksum.AbstractMetadataChecksummer
XMLStreamException
Copyright © 2014–2023 Norconex Inc.. All rights reserved.