GroupDocs.Metadata for Java 21.6 Release Notes

Major Features

There are the following features, enhancements and fixes in this release:

  • Implement property interpreters for all enum types across all formats

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
METADATANET-3846Implement property interpreters for all enum types across all formatsImprovement

Public API and Backward Incompatible Changes

Implement property interpreters for all enum types across all formats

This improvement allows the user to get a user-friendly interpretation of a metadata property representing an enum value. Please refer to this article for more information.

Public API changes

None

Use cases

Obtain a full list of properties that provide an interpreted value

public class WorkingWithInterpretedValues {
     public static void run() {
        File folder = new File(Constants.InputPath);
        for (File file : folder.listFiles()) {
            try (Metadata metadata = new Metadata(file.getAbsolutePath())) {
                if (metadata.getFileFormat() != FileFormat.Unknown && !metadata.getDocumentInfo().isEncrypted()) {
                    System.out.println();
                    System.out.println(file.getName());
                      
                    IReadOnlyList<MetadataProperty> properties = metadata.findProperties(
                            new WorkingWithInterpretedValues().new InterpretedValueIsNotNullSpecification());
                    for (MetadataProperty property : properties) {
                            System.out.println(property.getName());
                            System.out.println(property.getValue().getRawValue());
                            System.out.println(property.getInterpretedValue().getRawValue());
                    }
                }
            }
        }
    }
       
    private class InterpretedValueIsNotNullSpecification extends Specification {
        public /*override*/ boolean isSatisfiedBy(MetadataProperty candidate) {
            return candidate.getInterpretedValue() != null;
        }
    }
}