Code example for ZipEntry

Methods: getSizeisDirectory

0
	*/ 
	protected ZipEntry getZipEntry(String path) {
		if (path.length() > 0 && path.charAt(0) == '/')
			path = path.substring(1);
		ZipEntry entry = zipFile.getEntry(path);
		if (entry != null && entry.getSize() == 0 && !entry.isDirectory()) {
			// work around the directory bug see bug 83542 
			ZipEntry dirEntry = zipFile.getEntry(path + '/');
			if (dirEntry != null)
				entry = dirEntry;
		} 
		return entry;
	} 
 
	/** 
	 * Extracts a directory and all sub content to disk 
	 * @param dirName the directory name to extract 
	 * @return the File used to extract the content to.  A value 
	 * of <code>null</code> is returned if the directory to extract does  
	 * not exist or if content extraction is not supported. 
Experience pair programming with AI  Get Codota for Java