public class XMPMetadata extends Metadata
This class is not serializable!
LICENSE_LOCATION, LICENSE_URL, WORK_TYPE
ALTITUDE, LATITUDE, LONGITUDE
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, LOCATION
MESSAGE_BCC, MESSAGE_BCC_DISPLAY_NAME, MESSAGE_BCC_EMAIL, MESSAGE_BCC_NAME, MESSAGE_CC, MESSAGE_CC_DISPLAY_NAME, MESSAGE_CC_EMAIL, MESSAGE_CC_NAME, MESSAGE_FROM, MESSAGE_FROM_EMAIL, MESSAGE_FROM_NAME, MESSAGE_PREFIX, MESSAGE_RAW_HEADER_PREFIX, MESSAGE_RECIPIENT_ADDRESS, MESSAGE_TO, MESSAGE_TO_DISPLAY_NAME, MESSAGE_TO_EMAIL, MESSAGE_TO_NAME, MULTIPART_BOUNDARY, MULTIPART_SUBTYPE
ACKNOWLEDGEMENT, COMMAND_LINE, COMMENT, CONTACT, CONVENTIONS, EXPERIMENT_ID, HISTORY, INSTITUTION, MODEL_NAME_ENGLISH, PROGRAM_ID, PROJECT_ID, REALIZATION, REFERENCES, SOURCE, TABLE_ID
BITS_PER_SAMPLE, EQUIPMENT_MAKE, EQUIPMENT_MODEL, EXIF_PAGE_COUNT, EXPOSURE_TIME, F_NUMBER, FLASH_FIRED, FOCAL_LENGTH, IMAGE_LENGTH, IMAGE_WIDTH, ISO_SPEED_RATINGS, ORIENTATION, ORIGINAL_DATE, RESOLUTION_HORIZONTAL, RESOLUTION_UNIT, RESOLUTION_VERTICAL, SAMPLES_PER_PIXEL, SOFTWARE
MIME_TYPE_MAGIC, TIKA_MIME_FILE
Constructor and Description |
---|
XMPMetadata()
Initializes with an empty XMP packet
|
XMPMetadata(Metadata meta) |
XMPMetadata(Metadata meta,
String mimetype)
Initializes the data by converting the Metadata information to XMP.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
String value)
As this API could only possibly work for simple properties in XMP, it just calls the set
method, which replaces any existing value
|
static void |
deleteNamespace(String namespaceURI)
Deletes a namespace from the registry.
|
boolean |
equals(Object o)
This method is not implemented, yet.
|
String |
get(Property property)
Returns the value (if any) of the identified metadata property.
|
String |
get(String name)
Returns the value of a simple property or the first one of an array.
|
Date |
getDate(Property property)
Returns the value of the identified Date based metadata property.
|
Integer |
getInt(Property property)
Returns the value of the identified Integer based metadata property.
|
static String |
getNamespacePrefix(String namespaceURI)
Obtain the prefix for a registered namespace URI.
|
static Map<String,String> |
getNamespaces() |
static String |
getNamespaceURI(String namespacePrefix)
Obtain the URI for a registered namespace prefix.
|
static Map<String,String> |
getPrefixes() |
String[] |
getValues(Property property)
Get the values associated to a metadata name.
|
String[] |
getValues(String name)
Returns the value of a simple property or all if the property is an array and the elements
are of simple type.
|
com.adobe.internal.xmp.XMPMeta |
getXMPData()
Provides direct access to the XMP data model, in case a client prefers to work directly on it
instead of using the Metadata API
|
int |
hashCode() |
boolean |
isMultiValued(Property property)
Returns true if named value is multivalued.
|
boolean |
isMultiValued(String name)
Checks if the named property is an array.
|
String[] |
names()
For XMP it is not clear what that API should return, therefor not implemented
|
void |
process(Metadata meta) |
void |
process(Metadata meta,
String mimetype)
Converts the Metadata information to XMP.
|
static String |
registerNamespace(String namespaceURI,
String suggestedPrefix)
Register a namespace URI with a suggested prefix.
|
void |
remove(Property property) |
void |
remove(String name)
Removes the given property from the XMP data.
|
void |
set(Property property,
Date date)
Sets the date value of the identified metadata property.
|
void |
set(Property property,
double value)
Sets the real or rational value of the identified metadata property.
|
void |
set(Property property,
int value)
Sets the integer value of the identified metadata property.
|
void |
set(Property property,
String value)
Sets the value of the identified metadata property.
|
void |
set(Property property,
String[] values)
Sets array properties.
|
void |
set(String name,
String value)
Sets the given property.
|
void |
setAll(Properties properties)
It will set all simple and array properties that have QName keys in registered namespaces.
|
int |
size()
Returns the number of top-level namespaces
|
String |
toString()
Serializes the XMP data in compact form without packet wrapper
|
public XMPMetadata()
public XMPMetadata(Metadata meta) throws TikaException
TikaException
But the mimetype is retrieved from the metadata map.
public XMPMetadata(Metadata meta, String mimetype) throws TikaException
meta
- the Metadata information from Tika-coremimetype
- mimetype informationTikaException
- case an error occurred during conversionpublic static String registerNamespace(String namespaceURI, String suggestedPrefix) throws com.adobe.internal.xmp.XMPException
namespaceURI
- The URI for the namespace. Must be a valid XML URI.suggestedPrefix
- The suggested prefix to be used if the URI is not yet registered. Must be a valid
XML name.com.adobe.internal.xmp.XMPException
- If the parameters are not accordingly setpublic static String getNamespacePrefix(String namespaceURI)
namespaceURI
- The URI for the namespace. Must not be null or the empty string.public static String getNamespaceURI(String namespacePrefix)
namespacePrefix
- The prefix for the namespace. Must not be null or the empty string.public static Map<String,String> getNamespaces()
public static Map<String,String> getPrefixes()
public static void deleteNamespace(String namespaceURI)
Does nothing if the URI is not registered, or if the namespaceURI parameter is null or the empty string.
Note: Not yet implemented.
namespaceURI
- The URI for the namespace.public void process(Metadata meta) throws TikaException
TikaException
But the mimetype is retrieved from the metadata map.
public void process(Metadata meta, String mimetype) throws TikaException
meta
- the Metadata information from Tika-coremimetype
- mimetype informationTikaException
- case an error occurred during conversionpublic com.adobe.internal.xmp.XMPMeta getXMPData()
public boolean isMultiValued(Property property)
Metadata
isMultiValued
in class Metadata
property
- metadata propertyisMultiValued(java.lang.String)
public boolean isMultiValued(String name)
isMultiValued
in class Metadata
name
- name of metadataMetadata.isMultiValued(java.lang.String)
public String[] names()
public String get(String name)
get
in class Metadata
name
- of the metadata.Metadata.get(java.lang.String)
public String get(Property property)
Metadata
get
in class Metadata
property
- property definitionnull
if the property is not setget(java.lang.String)
public Integer getInt(Property property)
Metadata
getInt
in class Metadata
property
- simple integer property definitionnull
if the property is not set, or
not a valid Integerget(java.lang.String)
public Date getDate(Property property)
Metadata
getDate
in class Metadata
property
- simple date property definitionnull
if the property is not set, or not
a valid Dateget(java.lang.String)
public String[] getValues(Property property)
Metadata
getValues
in class Metadata
property
- of the metadata.getValues(java.lang.String)
public String[] getValues(String name)
getValues
in class Metadata
name
- of the metadata.Metadata.getValues(java.lang.String)
public void add(String name, String value)
add
in class Metadata
name
- the metadata name.value
- the metadata value.Metadata.add(java.lang.String, java.lang.String)
public void set(String name, String value)
set
in class Metadata
name
- the metadata name.value
- the metadata value, or null
Metadata.set(java.lang.String, java.lang.String)
public void set(Property property, String value)
Metadata
set
in class Metadata
property
- property definitionvalue
- property valueset(java.lang.String, java.lang.String)
public void set(Property property, int value)
Metadata
set
in class Metadata
property
- simple integer property definitionvalue
- property valueset(java.lang.String, java.lang.String)
public void set(Property property, double value)
Metadata
set
in class Metadata
property
- simple real or simple rational property definitionvalue
- property valueset(java.lang.String, java.lang.String)
public void set(Property property, Date date)
Metadata
set
in class Metadata
property
- simple integer property definitiondate
- property valueset(java.lang.String, java.lang.String)
public void set(Property property, String[] values)
set
in class Metadata
property
- property definitionvalues
- property valuesMetadata.set(org.apache.tika.metadata.Property,
java.lang.String[])
public void setAll(Properties properties)
setAll
in class Metadata
properties
- properties to copy fromMetadata.setAll(java.util.Properties)
public void remove(Property property)
remove(java.lang.String)
public void remove(String name)
remove
in class Metadata
name
- metadata name to removeMetadata.remove(java.lang.String)
public int size()
public boolean equals(Object o)
public String toString()
toString
in class Metadata
Metadata.toString()
Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.