Update Metadata from MPP File in Java

Metadata Editor for Java applications – Change metadata fields from all popular documents, images and multimedia file formats using metadata editor API for Java.

 Download Free Trial
HTML JPG PDF XML DOC
GroupDocs.Metadata for Java
PDF
MPP

GroupDocs.Metadatafor Java

About GroupDocs.Metadata for Java API

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.

Steps for MPP Metadata Extraction in Java

GroupDocs.Metadata makes it easy for Java developers to get metadata information from MPP files from within their applications by implementing a few easy steps.

  • Load the MPP file to be updated.
  • Specify a predicate that will be used to filter desired metadata properties.
  • Specify a value which you want to be assigned to the selected properties.
  • Pass the predicate and the new value to the UpdateProperties method.
  • Check the actual number of updated properties.
  • Save the changes.

System Requirements

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 installled on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environment: NetBeans, Intellij IDEA, Eclipse etc
  • Java Runtime Environment: J2SE 6.0 and above
  • Get the latest version of GroupDocs.Metadata for Java from Maven
 

Java code snippet to edit metadata

public class UpdatingMetadata {
    public static void run() {
        Date threeDaysAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(3));
        try (Metadata metadata = new Metadata("input.mpp")) {
                // 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.mpp");
        }
    }

    // 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;
        }
    }
}

Live Demos of Editing Metadata

Update metadata information of MPP file right now by visiting GroupDocs.Metadata Live Demos website.
The live demo has the following benefits

  No need to download GroupDocs API.
  No need to write any code.
  Upload the file to get metadata information of MPP.
  Get the download link to save the file on your machine.
 
 

mppAbout MPP File Format

A file with MPP extension is Microsoft Project data file that stores information related to project management in an integrated manner. It is proprietary file format developed by Microsoft as file format for Microsoft Project (MSP) which is a project management application software. Besides MPP, MSP supports other file formats as well like project XML schema. Several APIs and applications provide the facility to convert MPP file format to others. Microsoft now has online Project Server where project management files can be uploaded for collaboration by multiple users.

Read More

Changing Metadata Of Other File Formats

Multi format documents and images metadata editing API for Java. Get metadata details of some of the popular file formats as stated below.