MsgRootPackage

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.RootMetadataPackage, com.groupdocs.metadata.core.EmailRootPackage

public class MsgRootPackage extends EmailRootPackage

Represents the root package allowing working with metadata in an MSG email message.

Learn more

This code sample shows how to extract metadata from an MSG message.

try (Metadata metadata = new Metadata(Constants.InputMsg)) { MsgRootPackage root = metadata.getRootPackageGeneric(); System.out.println(root.getMsgPackage().getSender()); System.out.println(root.getMsgPackage().getSubject()); for (String recipient : root.getMsgPackage().getRecipients()) { System.out.println(recipient); } for (String attachedFileName : root.getMsgPackage().getAttachedFileNames()) { System.out.println(attachedFileName); } for (MetadataProperty header : root.getMsgPackage().getHeaders()) { System.out.println(String.format("%s = %s", header.getName(), header.getValue())); } System.out.println(root.getMsgPackage().getBody()); System.out.println(root.getMsgPackage().getDeliveryTime()); // … }

Methods

Method Description
getMsgPackage() Gets the MSG metadata package.
getString(MsgKnownProperties tag) Gets the string value of the property specified by tag.

getMsgPackage()

public final MsgPackage getMsgPackage()

Gets the MSG metadata package.

Returns: MsgPackage - The MSG metadata package.

getString(MsgKnownProperties tag)

public final String getString(MsgKnownProperties tag)

Gets the string value of the property specified by tag.

Parameters:

Parameter Type Description
tag MsgKnownProperties The value from MsgKnownProperties enum.

Returns: java.lang.String - The value of the property. If the property does not exist, returns null; otherwise, returns the value.