use of com.adobe.xmp.XMPDateTime in project tika by apache.
the class XMPMetadata method getDate.
/**
* @see org.apache.tika.xmp.XMPMetadata#get(java.lang.String)
*/
@Override
public Date getDate(Property property) {
Date result = null;
try {
XMPDateTime xmpDate = XMPUtils.convertToDate(this.get(property.getName()));
if (xmpDate != null) {
Calendar cal = xmpDate.getCalendar();
// TODO Timezone is currently lost
// need another solution that preserves the timezone
result = cal.getTime();
}
} catch (XMPException e) {
// Ignore
}
return result;
}
Aggregations