GroupDocs.Metadata for Java is an advanced metadata fields manipulation solution to easily read, add, modify, delete, search, compare, replace and export metadata information from images and document formats without using any external software. Edit metadata details from Word documents, Excel spreadsheets, PowerPoint presentations, Outlook emails, OneNote, Visio, Project, PDF, AutoCAD, ZIp, Audio and Video file formats along with the support for working with many other metadata processing features.
GroupDocs.Metadata for Java makes it easy for Java developers to edit metadata details to ODT files from within their applications by implementing a few easy steps.
GroupDocs.Metadata for Java APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.
public class UpdatingMetadata
{
public static void run()
{
Date threeDaysAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(3));
try (Metadata metadata = new Metadata("input.odt"))
{
// Update the file creation date/time if the existing value is older than 3 days
int affected = metadata.updateProperties(new ContainsTagSpecification(Tags.getTime().getCreated()).and(
new OfTypeSpecification(MetadataPropertyType.DateTime)).and(
new UpdatingMetadata().new DateBeforeSpecification(threeDaysAgo)), new PropertyValue(new Date()));
System.out.println(String.format("Affected properties: %s", affected));
metadata.save("output.odt");
}
}
// Define your own specifications to filter metadata properties
public class DateBeforeSpecification extends Specification
{
public DateBeforeSpecification(Date date)
{
setValue(date);
}
public final Date getValue()
{
return auto_Value;
}
private void setValue(Date value)
{
auto_Value = value;
}
private Date auto_Value;
public boolean isSatisfiedBy(MetadataProperty candidate)
{
Date date = candidate.getValue().toClass(Date.class);
if (date != null)
{
return date.before(getValue());
}
return false;
}
}
}
Update metadata information to ODT file right now by visiting GroupDocs.Metadata Live Demos website. The live demo has the following benefits.
No need to download API
No need to write any code
Just upload the source file
Get download link to save the file
Multi format documents and images metadata editing API for Java. Retrieve metadata of some of the popular file formats as stated below.
(Zipped File)
(Excel Template)
(Excel Macro-Enabled Template)
(Excel 97 - 2003 Template)
(Open XML Workbook)
(Macro-enabled Spreadsheet)
(Excel Binary Workbook)
(Microsoft Excel Spreadsheet (Legacy))
(Windows Metafile)
(Raster Web Image Format)
(WAVE Audio File)
(Visio Stencil XML File)
(Visio Stencil File)
(Visio Drawing)
(Visio Drawing File)
(The 7th Guest Video File)
(vCard File)
(TrueType Font)
(TrueType Font Collection)
(Tagged Image File Format)
(Photoshop Document)
(Open XML presentation Format)
(Macro-enabled Presentation File)
(Microsoft PowerPoint 97-2003)
(PowerPoint Slide Show)
(Macro-enabled Slide Show)
(PowerPoint Slide Show)
(Microsoft PowerPoint Template Presentation)
(Microsoft PowerPoint Template File)
(Microsoft PowerPoint Template Files)
(Portable Network Graphic)
(Portable Document Format)
(OpenType Font)
(OpenDocument Spreadsheet)
(Outlook Message Item File)
(Microsoft Project Template)
(Microsoft Project File)
(MP3 Audio File)
(Apple QuickTime Movie)
(JPEG 2000 Image)
(Joint Photographic Expert Group Image)
(JPEG 2000 Core Image)
(High Efficiency Image Format)
(High Efficiency Image Format)
(Graphical Interchange Format)
(Flash Video File)
(Open eBook File)
(E-Mail Message)
(Enhanced Metafile Format)
(Autodesk Drawing Exchange Format)
(AutoCAD Drawing File)
(Microsoft Word Template File )
(Microsoft Word 2007+ Template File)
(Microsoft Word Template Files)
(Office 2007+ Word Document)
(Microsoft Word 2007 Marco File)
(Microsoft Word Binary Format)
(Graphics File Format)
(Digital Imaging and Communications in Medicine)
(DICOM Image)
(Bitmap Image File)
(Audio Video Interleave File)
(Advanced Systems Format File)
(Matroska Video File)
(OneNote Document)
(Graphics File Format)