Code example for JarEntry

Methods: setCrcsetMethodsetSizesetTime

0
 
	public void addZipEntry(ZipEntry zipEntry, ZipFile zipFile, String path) throws IOException {
		if (fJarPackage.areDirectoryEntriesIncluded())
			addDirectories(path);
 
		JarEntry newEntry= new JarEntry(path.replace(File.separatorChar, '/'));
 
		if (fJarPackage.isCompressed())
			newEntry.setMethod(ZipEntry.DEFLATED);
			// Entry is filled automatically. 
		else { 
			newEntry.setMethod(ZipEntry.STORED);
			newEntry.setSize(zipEntry.getSize());
			newEntry.setCrc(zipEntry.getCrc());
		} 
 
		long lastModified= System.currentTimeMillis();
 
		// Set modification time 
		newEntry.setTime(lastModified);
 
		addEntry(newEntry, zipFile.getInputStream(zipEntry));
	} 
 
	public void addZipEntryStream(ZipEntry zipEntry, InputStream is, String path) throws IOException {
		if (fJarPackage.areDirectoryEntriesIncluded())
			addDirectories(path);
Connect your IDE to all the code out there  Get Codota for Java