Charsetcharset=Charset.forName("cp866");try(Metadatametadata=newMetadata(Constants.InputZip)){ZipRootPackageroot=metadata.getRootPackageGeneric();System.out.println(root.getZipPackage().getComment());System.out.println(root.getZipPackage().getTotalEntries());for(ZipFilefile: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 namesSystem.out.println(newString(file.getRawName(),charset));}}
Updating the user comment
GroupDocs.Metadata for Java allows you to update the user comment in a ZIP archive. The following steps are needed to be followed:
GroupDocs.Metadata for Java allows you to remove the user comment associated with a ZIP archive. The following code snippet demonstrates the usage of this feature.