private void addFile(File file, IPath path) throws IOException { if (fJarPackage.areDirectoryEntriesIncluded()) addDirectories(path); JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/')); if (fJarPackage.isCompressed()) newEntry.setMethod(ZipEntry.DEFLATED); // Entry is filled automatically. else { newEntry.setMethod(ZipEntry.STORED); JarPackagerUtil.calculateCrcAndSize(newEntry, new FileInputStream(file), new byte[4096]); } newEntry.setTime(file.lastModified()); addEntry(newEntry, new FileInputStream(file)); } }
private void addFile(File file, IPath path) throws IOException { if (fJarPackage.areDirectoryEntriesIncluded()) addDirectories(path); JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/')); if (fJarPackage.isCompressed()) newEntry.setMethod(ZipEntry.DEFLATED); // Entry is filled automatically. else { newEntry.setMethod(ZipEntry.STORED); JarPackagerUtil.calculateCrcAndSize(newEntry, new FileInputStream(file), new byte[4096]); } newEntry.setTime(file.lastModified()); addEntry(newEntry, new FileInputStream(file)); } }
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 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); 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, is); }
public void addZipEntryStream(ZipEntry zipEntry, InputStream is, 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, is); }