Class DateNormalizingMetadataFilter

All Implemented Interfaces:
Closeable, Serializable, AutoCloseable

public class DateNormalizingMetadataFilter extends MetadataFilterBase
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:
  • Constructor Details

    • DateNormalizingMetadataFilter

      public DateNormalizingMetadataFilter()
    • DateNormalizingMetadataFilter

      public DateNormalizingMetadataFilter(DateNormalizingMetadataFilter.Config config)
      Constructor with explicit Config object.
      Parameters:
      config - the configuration
    • DateNormalizingMetadataFilter

      public DateNormalizingMetadataFilter(JsonConfig jsonConfig)
      Constructor for JSON configuration. Requires Jackson on the classpath.
      Parameters:
      jsonConfig - JSON configuration
  • Method Details

    • filter

      protected void filter(Metadata metadata)
      Specified by:
      filter in class MetadataFilterBase
    • setDefaultTimeZone

      public void setDefaultTimeZone(String timeZoneId)
    • getDefaultTimeZone

      public String getDefaultTimeZone()