Dear GroupDocs users, we’re pleased to announce GroupDocs.Metadata for Java 26.11.
This release adds eight new formats: five archive formats, OGG audio, and FB2 and MOBI e-books. Documents can now be loaded directly from a URI. The release also exposes many more MSG email properties, makes PDF sanitizing more thorough, fixes empty CAD previews, and updates the bundled Aspose libraries.
Most of the changes only add new API. Please read the Behavior changes section before upgrading: PDF sanitizing, archive detection and MPEG audio headers behave differently.
Feature — five new archive formats
Metadata can be read from Apple Archive (.aar), GZIP (.gz), BZ2 (.bz2), XZ (.xz) and Zstandard (.zst) files.
import com.groupdocs.metadata.Metadata;
import com.groupdocs.metadata.core.GzipPackage;
import com.groupdocs.metadata.core.GzipRootPackage;
try (Metadata metadata = new Metadata("backup.gz")) {
GzipRootPackage root = metadata.getRootPackageGeneric();
GzipPackage gzip = root.getGzipPackage();
System.out.println(gzip.getName() + ": " + gzip.getSize() + " -> " + gzip.getUncompressedSize() + " bytes");
}
Scope.
- New
FileTypeconstants:AAR,GZIP,BZ2,XZ,ZSTD. - Each format has its own root package:
AarRootPackage,GzipRootPackage,Bz2RootPackage,XzRootPackageandZstdRootPackage. All five are read-only. - For AAR you also get the list of entries (
AarFile), each with a name, a length and a directory flag. (METADATANET-4251)
Feature — OGG audio, FB2 and MOBI e-books
import com.groupdocs.metadata.Metadata;
import com.groupdocs.metadata.core.OggPackage;
import com.groupdocs.metadata.core.OggRootPackage;
try (Metadata metadata = new Metadata("track.ogg")) {
OggRootPackage root = metadata.getRootPackageGeneric();
OggPackage ogg = root.getOggPackage();
System.out.println(ogg.getArtist() + " - " + ogg.getTitle() + " (" + ogg.getAlbum() + ")");
}
Scope.
- OGG (Vorbis).
OggPackagereads the standard Vorbis comments, such as title, artist, album, genre, date, copyright and ISRC. Any other comments are returned bygetOggUserComments(). (METADATANET-4083) - FB2 (FictionBook 2).
Fb2Packagereads the title info, the source title info, the document info and the publish info: authors, genres, language, sequence, publisher and so on. FB2 is read-only. (METADATANET-4077) - MOBI.
MobiPackageexposes the PDB header and the MOBI header. The book’s full name can be changed withMobiHeader.setFullName(...)and saved back to the file.
Feature — load a document from a URI
Two new constructors, Metadata(URI) and Metadata(URI, LoadOptions), download the document and load it, so you don’t need to fetch it yourself first.
try (Metadata metadata = new Metadata(new URI("https://example.com/files/report.docx"))) {
System.out.println(metadata.getFileFormat());
}
(METADATANET-4094)
Feature — much richer MSG and EML metadata
MsgPackage gains about 30 MAPI properties, and several of them can be edited:
- the body, HTML body and RTF body;
- the categories and the sender name;
- the delivery time and the client submit time;
- the billing information, the reply-to address and the read receipt flag.
try (Metadata metadata = new Metadata("message.msg")) {
MsgRootPackage root = metadata.getRootPackageGeneric();
MsgPackage msg = root.getMsgPackage();
System.out.println(msg.getInternetMessageId() + ", encrypted: " + msg.isEncrypted());
msg.setSenderName("Support Team");
msg.setCategories(new String[] { "Reviewed" });
metadata.save("message-updated.msg");
}
Scope.
- New read-only MSG properties:
- the Internet message ID and the conversation topic;
- the To, Cc and Bcc display names;
- the normalized subject and the subject prefix;
- the sender and “sent representing” address types and SMTP addresses;
- the transport headers;
- the encryption, signature and template flags.
EmailPackage.getSenderEmailAddress()replacesgetSender(). The old method still works but is deprecated.- Headers can be replaced with
EmailPackage.setHeaders(...)or set one at a time withEmailHeaderPackage.set(header, value). - EML attachments can be read and replaced with
EmlPackage.getAttachments()andEmlPackage.setAttachments(...). - (METADATANET-4099, METADATANET-4110, METADATANET-4111, METADATANET-4121, METADATANET-4123, METADATANET-4124)
Enhancement — more thorough PDF sanitizing
Metadata.sanitize() now removes annotations, attachments, bookmarks, form fields and digital signatures from PDF documents. Before this release it removed annotations only. (METADATANET-4139)
Fix — empty CAD previews
The preview image of DWG and DXF drawings was rendered into an internal buffer and never reached the caller’s stream. Previews are now written to the stream you pass in.
Fix — wrong format detection
Two kinds of files were opened as the wrong format:
- RAR, 7z and TAR archives could be detected as MP3, because MPEG frame detection matched bytes inside the archive;
- AVIF images could be detected as MP3, MOV or HEIF.
Both are now opened as their actual format.
Behavior changes
-
PDF sanitizing. As described above,
sanitize()now also removes PDF attachments, bookmarks, form fields and digital signatures. If you need to keep any of them, remove only the properties you need instead of callingsanitize(). -
Archive detection. RAR, 7z, TAR and the new archive formats are recognized by their file extension. When you load such an archive from an
InputStreamor a URI, set the format explicitly:new Metadata(stream, new LoadOptions(FileFormat.Rar)) -
MPEG audio headers. The properties of
MpegAudioPackagedescribe the audio stream (for example version, channel mode, bitrate and frequency), so they are now read-only. -
Email sender property. In the property list, the email sender property is now named
SenderEmailAddressinstead ofSender. Update any code that looks it up by name.
Also in this release
WordProcessingPackagehas three new properties:HyperlinksChanged,ScaleCropandSharedDoc.- Two new tags were added:
Tags.getTime().getDelivery()andTags.getTool().getCompression(). More properties are now tagged, so tag-based searches withfindPropertiesfind more. - The bundled Aspose libraries are updated to current versions: Words 26.8, Cells 26.9, Slides 26.9, PDF 26.8.1, Email 26.8, CAD 26.8, PSD 26.8, Diagram 26.9, Barcode 26.6, Imaging 25.12 and ZIP 26.7.
- Smaller fixes were made for:
- consistent
equals/hashCodeof raw tags; - null-safe JSON import;
- integer overflow in size calculations;
- streams that ZIP packing left open.
- consistent
Resources