Code example for ZipEntry

Methods: getSize

0
	} 
	public InputStream unzip(final String name) throws ZipException, IOException {
		final ZipFile zip = getZip();
		final ZipEntry entry = zip.getEntry(name);
		if (entry != null) {
			final long entrySize = entry.getSize();
			if (entrySize <= maxEntrySize) {
				logger.debug("Unzipping \"{}\" from \"{}\"", name, file);
				return zip.getInputStream(entry);
			} else { 
				logger.warn("The zip entry \"" + name + "\" is larger than the maximal entry size and will be skipped: " + entrySize + " > " + maxEntrySize);
			} 
		} else { 
			logger.warn("Zip file \"{}\" did not contain entry named \"{}\"", file, name);
		} 
		return null; 
	} 
 
	public void close() throws IOException {
		zip.close();