ZipRootPackage

On this page

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

public class ZipRootPackage extends RootMetadataPackage

Represents the root package allowing working with metadata in a ZIP archive.

Learn more


The following code snippet shows how to get metadata from a ZIP archive.

```

 Charset charset = Charset.forName("cp866");
 try (Metadata metadata = new Metadata(Constants.InputZip)) {
     ZipRootPackage root = metadata.getRootPackageGeneric();
     System.out.println(root.getZipPackage().getComment());
     System.out.println(root.getZipPackage().getTotalEntries());
     for (ZipFile file : root.getZipPackage().getFiles()) {
         System.out.println(file.getName());
         System.out.println(file.getCompressedSize());
         System.out.println(file.getCompressionMethod());
         System.out.println(file.getFlags());
         System.out.println(file.getModificationDateTime());
         System.out.println(file.getUncompressedSize());
         // Use a specific encoding for the file names
         System.out.println(new String(file.getRawName(), charset));
     }
 }
 
```

Methods

Method Description
getZipPackage() Gets the ZIP metadata package.

getZipPackage()

public final ZipPackage getZipPackage()

Gets the ZIP metadata package.

Returns: ZipPackage - The ZIP metadata package.

On this page