use of com.adobe.xmp.options.PropertyOptions in project tika by apache.
the class XMPMetadata method set.
/**
* Sets array properties. If the property already exists, it is overwritten. Only array
* properties that use a registered prefix are stored in the XMP.
*
* @see org.apache.tika.metadata.Metadata#set(org.apache.tika.metadata.Property,
* java.lang.String[])
*/
@Override
public void set(Property property, String[] values) {
checkKey(property.getName());
if (!property.isMultiValuePermitted()) {
throw new PropertyTypeException("Property is not of an array type");
}
String[] keyParts = splitKey(property.getName());
String ns = registry.getNamespaceURI(keyParts[0]);
if (ns != null) {
try {
int arrayType = tikaToXMPArrayType(property.getPrimaryProperty().getPropertyType());
xmpData.setProperty(ns, keyParts[1], null, new PropertyOptions(arrayType));
for (String value : values) {
xmpData.appendArrayItem(ns, keyParts[1], value);
}
} catch (XMPException e) {
// Ignore
}
}
}
Aggregations