Change Diagram Creation Time in Metadata with GroupDocs Java

In this step‑by‑step tutorial you’ll discover how to change diagram creation time and update other built‑in properties of diagram files using the GroupDocs.Metadata library for Java. Automating these changes saves hours of manual editing, guarantees consistent timestamps across your repository, and makes your diagrams instantly searchable in any document‑management system.

Quick Answers

  • What is the primary goal? Change diagram creation time and other metadata in diagram files.
  • Which library should I use? GroupDocs.Metadata for Java.
  • Do I need a license? A free trial is enough for testing; a full license is required for production.
  • Can I batch‑process many diagrams? Yes—wrap the same logic in a loop or a parallel stream.
  • What Java version is required? JDK 8 or higher.

What is “change diagram creation time” in diagram metadata?

Changing the creation time overwrites the original timestamp stored inside a diagram file (such as VDX or VSDX) with a new date‑time value. This lets you align the file’s metadata with the actual processing or archiving date instead of the author’s original timestamp, which is essential for audit trails and accurate search results.

Why automate metadata update for diagrams?

Automating metadata ensures that every diagram follows the same naming, categorization, and timestamp standards without human error. It also speeds up bulk migrations, reduces compliance risk, and improves discoverability in enterprise DMS platforms—saving up to 70 % of manual effort in large‑scale projects.

Prerequisites

  • Java Development Kit (JDK) 8+ installed on your machine.
  • IDE such as IntelliJ IDEA or Eclipse.
  • Maven (or manual JAR handling) for dependency management.
  • Basic familiarity with Java classes, methods, and exception handling.

Required Libraries and Dependencies

Add the following repository and dependency to your pom.xml file if using Maven:

<repositories>
   <repository>
      <id>repository.groupdocs.com</id>
      <name>GroupDocs Repository</name>
      <url>https://releases.groupdocs.com/metadata/java/</url>
   </repository>
</repositories>

<dependencies>
   <dependency>
      <groupId>com.groupdocs</groupId>
      <artifactId>groupdocs-metadata</artifactId>
      <version>24.12</version>
   </dependency>
</dependencies>

If you prefer downloading directly, visit GroupDocs.Metadata for Java releases to get the latest version.

Environment Setup

  • JDK 8 or newer.
  • IntelliJ IDEA, Eclipse, or any Java‑compatible IDE.

Knowledge Prerequisites

Understanding of Java syntax and basic file I/O will make the tutorial smoother, but the steps are explained in plain language.

Setting Up GroupDocs.Metadata for Java

Installation Instructions

Maven Users: The snippet above adds the repository and the required JAR automatically.
Direct Download Users: After downloading the JAR from GroupDocs, add it to your project’s classpath.

License Acquisition

  • Free Trial: Explore the library without cost.
  • Temporary License: Obtain a temporary license for extended testing here.
  • Purchase: Acquire a full license for production environments.

Basic Initialization

Metadata is the core class that represents a document’s metadata container and provides read/write access to all built‑in properties. To start using GroupDocs.Metadata, import the class and open a diagram file:

import com.groupdocs.metadata.Metadata;

// Load a diagram document and access its metadata
try (Metadata metadata = new Metadata("YOUR_DOCUMENT_DIRECTORY/InputVdx")) {
    // Your code here
}

With the library initialized, you can now modify any built‑in property, including the creation time.

Implementation Guide

How to change creation time in diagram files

In this section we’ll walk through each step required to change diagram creation time and update other common properties such as author, company, and category. The process involves loading the diagram with the Metadata API, accessing its root package, setting the desired fields, and finally saving the changes to a new file, ensuring the original remains untouched.

Step 1: Load the Diagram Document

try (Metadata metadata = new Metadata("YOUR_DOCUMENT_DIRECTORY/InputVdx")) {
    // Access and update document properties here
}

Explanation: The Metadata constructor receives the path to your diagram file. The try‑with‑resources block ensures the file is closed properly after the operation.

Step 2: Access the Root Package

DiagramRootPackage root = metadata.getRootPackageGeneric();

Explanation: The root package gives you direct access to all built‑in metadata fields for the diagram.

Step 3: Set the Creator Property

root.getDocumentProperties().setCreator("test author");

Explanation: Assigns a new author name. Replace "test author" with the actual creator.

Step 4: Change Creation Time

root.getDocumentProperties().setTimeCreated(new Date());

Explanation: This line changes creation time to the current system date and time. You can also supply a specific Date instance if you need a custom timestamp.

Step 5: Define Company Information

root.getDocumentProperties().setCompany("GroupDocs");

Explanation: Stores the company name associated with the diagram—useful for enterprise tracking.

Step 6: Set Document Category

root.getDocumentProperties().setCategory("test category");

Explanation: Categorizes the file, helping you update diagram category consistently across your repository.

Step 7: Add Keywords

root.getDocumentProperties().setKeywords("metadata, built-in, update");

Explanation: Keywords improve searchability; you can list any terms relevant to the diagram’s content.

Step 8: Save Changes

metadata.save("YOUR_OUTPUT_DIRECTORY/OutputVdx");

Explanation: Persists all modifications to a new file, leaving the original untouched.

Common Pitfalls & Troubleshooting

  • File Not Found: Verify the input path and ensure the file extension matches the actual format.
  • Access Denied: Check read/write permissions for both input and output directories.
  • Invalid Date Format: Use java.util.Date or java.time objects compatible with the API.

Practical Applications

  1. Automating Document Archiving – When moving old diagrams to an archive, automatically change diagram creation time to the archiving date and set a uniform category.
  2. Version Control Integration – Keep timestamps in sync with Git commits by updating creation time during each release.
  3. Enterprise DMS Standardization – Enforce a company‑wide policy for author, company, and keywords across all diagram assets.

Performance Considerations

  • Batch Processing: Wrap the above steps inside a loop to handle dozens of files in one run.
  • Memory Management: Release each Metadata instance promptly (the try‑with‑resources block does this automatically).
  • Asynchronous Execution: For large batches, consider CompletableFuture to run updates in parallel without blocking the main thread.
  • Quantified Capability: GroupDocs.Metadata supports over 30 diagram formats and can process files up to 500 MB without loading the entire document into memory, delivering updates in under 200 ms per file on typical server hardware.

Conclusion

You now know how to change diagram creation time and update other built‑in metadata properties for diagram documents using GroupDocs.Metadata in Java. By automating these steps, you can maintain consistent, searchable, and compliant documentation across your organization.

Next Steps

  • Experiment with other file formats supported by GroupDocs.Metadata (PDF, DOCX, etc.).
  • Integrate the code into a CI/CD pipeline to enforce metadata standards on every build.

Ready to try it out? Head over to GroupDocs.Metadata for Java releases and start implementing your own metadata automation today.


Last Updated: 2026-06-17
Tested With: GroupDocs.Metadata 24.12
Author: GroupDocs

Frequently Asked Questions

Q: Can I use this approach with other diagram formats like VSDX?
A: Yes, the same API works for all diagram formats supported by GroupDocs.Metadata.

Q: Do I need a license for development builds?
A: A free trial is sufficient for development and testing; a full license is required for production deployments.

Q: How can I update multiple properties in one call?
A: Set each property on the DocumentProperties object before invoking metadata.save(...); the library writes them all at once.

Q: Is it safe to overwrite the original file?
A: It’s recommended to save to a new file (as shown) and replace the original only after confirming the update succeeded.

Q: What if I need to set a custom creation date instead of the current time?
A: Create a java.util.Date (or java.time instance) with the desired timestamp and pass it to setTimeCreated.