Package org.apache.tika.metadata.filter
Class DateNormalizingMetadataFilter
java.lang.Object
org.apache.tika.metadata.filter.MetadataFilter
org.apache.tika.metadata.filter.MetadataFilterBase
org.apache.tika.metadata.filter.DateNormalizingMetadataFilter
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable
Some dates in some file formats do not have a timezone.
Tika correctly stores these without a timezone, e.g. 'yyyy-MM-dd'T'HH:mm:ss'
This can be a problem if end points expect a 'Z' timezone.
This filter makes the assumption that dates without timezones are UTC
and always modifies the date to: "yyyy-MM-dd'T'HH:mm:ss'Z'"
Users can specify an alternate defaultTimeZone with
setDefaultTimeZone(String) to apply
if the file format does not specify a timezone.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration class for JSON deserialization. -
Constructor Summary
ConstructorsConstructorDescriptionDateNormalizingMetadataFilter(JsonConfig jsonConfig) Constructor for JSON configuration.Constructor with explicit Config object. -
Method Summary
Methods inherited from class org.apache.tika.metadata.filter.MetadataFilterBase
doFilterMethods inherited from class org.apache.tika.metadata.filter.MetadataFilter
close, filter, filter
-
Constructor Details
-
DateNormalizingMetadataFilter
public DateNormalizingMetadataFilter() -
DateNormalizingMetadataFilter
Constructor with explicit Config object.- Parameters:
config- the configuration
-
DateNormalizingMetadataFilter
Constructor for JSON configuration. Requires Jackson on the classpath.- Parameters:
jsonConfig- JSON configuration
-
-
Method Details
-
filter
- Specified by:
filterin classMetadataFilterBase
-
setDefaultTimeZone
-
getDefaultTimeZone
-