Search in sources :

Example 1 with XMPDateTime

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;
}
Also used : Calendar(java.util.Calendar) XMPDateTime(com.adobe.xmp.XMPDateTime) XMPException(com.adobe.xmp.XMPException) Date(java.util.Date)

Aggregations

XMPDateTime (com.adobe.xmp.XMPDateTime)1 XMPException (com.adobe.xmp.XMPException)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1