GroupDocs Java を使用したダイアグラム メタデータの作成時間の変更

creator、change creation time、category順で変更リンス ヒントの適用方法を順を追って説明し、ドキュメントを一貫性があり検索可能な状態に保つ方法をご紹介します。

Quick Answers

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

What is “change creation time” in diagram metadata?

Changing the creation time means overwriting the original timestamp stored inside a diagram file (e.g., VDX, VSDX) with a new date. This is useful when you need the file’s metadata to reflect the actual processing date rather than the original authoring date.

Why automate metadata update for diagrams?

  • Consistency: Guarantees every file follows the same naming and categorization rules.
  • Searchability: Updated keywords and categories improve document discovery in DMS solutions by ensuring accurate timestamps.

Prerequisites

  • **Java Development Kit (JDK) management.
  • Basic knowledge of 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

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 creation time and update other common properties such as author, company, and category.

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 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.

Conclusion

You now know how to change 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-01-19
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 IA: A free trial is sufficient for development and testing; a full license is required for production deployments.

**Q: How can`; 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) to avoid data loss, then replace the original if needed.

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.