Hello,
I have a little trouble. I have to zip a directory, so far, things are going pretty well, he zipped the directory. However, I get the directory size before compression zip the directory size after compression zip, and then the compression ratio. How can I do to obtain these values?
Here is my code:
Code:
/ / Create the z with the folder name
z = new ZipOutputStream(new FileOutputStream(folder.getName() + ". z"));
/ / Set the compression mode
z.setMethod(ZipOutputStream.Deflated);
/ / Set the compression level = BEST
z.setlevel(9);
/ / It defines a directory path with the "File"
File directory = new File(folder.getPath());
/ / We archive all files (recursive) files and
zpeRepertoire(directory, z);
/ / We close the z
z.close();
Can you help me with this.
Bookmarks