List of usage examples for org.apache.commons.compress.archivers.zip ZipArchiveEntry setSize
public void setSize(long size)
From source file:org.waarp.common.tar.ZipUtility.java
/** * Recursive traversal to add files/* w ww . j av a2s .co m*/ * * @param file * @param zaos * @throws IOException */ private static void addFile(File file, ZipArchiveOutputStream zaos) throws IOException { String filename = null; filename = file.getName(); ZipArchiveEntry zae = new ZipArchiveEntry(filename); zae.setSize(file.length()); zaos.putArchiveEntry(zae); FileInputStream fis = new FileInputStream(file); IOUtils.copy(fis, zaos); zaos.closeArchiveEntry(); }