Extract uncompressed size of zip file embedded in jar
问题 I have a zip file embedded in my jar and want to read the uncompressed size. My current way of doing this: ZipFile zipFile = new ZipFile(new File(this.getClass().getClassLoader().getResource("files.zip").toURI())); Enumeration<? extends ZipEntry> e = zipFile.entries(); long installedSize = 0; while (e.hasMoreElements()) { ZipEntry entry = e.nextElement(); installedSize += entry.getSize(); } This is of course rather dirty and also doesn't work when I embed my jar file into an exe file using