try {
// count the zip entries so we can do progress bar
long totalSize = 0L;
for (Enumeration<? extends ZipEntry> it = zip.entries(); it
.hasMoreElements();) {
ZipEntry e = it.nextElement();
totalSize += e.getSize();
}
long bytesSoFar = 0L;
for (Enumeration<? extends ZipEntry> it = zip.entries(); it
.hasMoreElements();) {
ZipEntry entry = it.nextElement();
// zip entries can be created on windows or unix, and can retain
// the path separator for that platform. We must ensure that
// the paths we find inside the zip file will work on the platform
// we are running on. Technically, zip entry paths should be
// created using the unix separator, no matter what platform they
// are created on - but this is not always done correctly.
final String entryName = getPlatformSpecificPath(entry.getName());
File expandedFile = new File(destination + File.separator
+ entryName);
BufferedInputStream in = new BufferedInputStream(zip