com.groupdocs.metadata.core

Interfaces

Classes

Exceptions

com.groupdocs.metadata.core

Class VCardRootPackage

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    public class VCardRootPackage
    extends RootMetadataPackage

    Represents the root package allowing working with metadata in a VCard file.

    Learn more

    This code sample demonstrates how to read metadata properties of a vCard file.

    public static void run() {
         try (Metadata metadata = new Metadata(Constants.InputVcf)) {
             VCardRootPackage root = metadata.getRootPackageGeneric();
             for (VCardCard vCard : root.getVCardPackage().getCards()) {
                 System.out.println(vCard.getIdentificationRecordset().getName());
                 PrintArray(vCard.getIdentificationRecordset().getFormattedNames());
                 PrintArray(vCard.getCommunicationRecordset().getEmails());
                 PrintArray(vCard.getCommunicationRecordset().getTelephones());
                 PrintArray(vCard.getDeliveryAddressingRecordset().getAddresses());
                 // ...
             }
         }
     }
     private static void PrintArray(String[] values) {
         if (values != null) {
             for (String value : values) {
                 System.out.println(value);
             }
         }
     }
     
    • Method Detail

      • getVCardPackage

        public final VCardPackage getVCardPackage()

        Gets the VCard metadata package.

        Returns:
        The VCard metadata package.