Class ReservedNamespaces

java.lang.Object
org.apache.tika.metadata.ReservedNamespaces

public final class ReservedNamespaces extends Object
Classifies metadata keys by who is allowed to assert them. The Tika-native namespace (tk:) is guarded on the String write route: a key name derived from file content (a blind scrape) that lands in this namespace is a forgery and is refused (thrown) rather than honored, and the public Property factories reject reserved names at construction. This is a file-borne-forgery guard and an internal-bug detector — not a sealed boundary: Metadata.setTrusted(java.lang.String, java.lang.String), Metadata.reconstruct(java.lang.String, java.lang.String, boolean), and Metadata.putAll(org.apache.tika.metadata.Metadata) deliberately write reserved keys for filters, serialization, and pipes user metadata.
Since:
Apache Tika 4.0.0
  • Method Details

    • isTikaNative

      public static boolean isTikaNative(String name)
      Is name in the Tika-native namespace? True for the current tk: prefix and the pre-4.0.0 X-TIKA: prefix — the legacy prefix stays reserved so a crafted file cannot forge it during the 4.x window even though Tika no longer writes it.
      Parameters:
      name - a metadata key name (may be null)
      Returns:
      true if the key belongs to the reserved Tika-native namespace