List of utility methods to do FileOutputStream Write
void | saveZipFile(String zipFileName, File toBeZipped) Create a zip file containing the given File. try { if (!zipFileName.endsWith(".zip")) { zipFileName += ".zip"; File zipFile = new File(zipFileName); if (!zipFile.getParentFile().exists()) { zipFile.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zoStream = new ZipOutputStream(fos); writeZipEntry(toBeZipped, zoStream, toBeZipped.getParent().length() + 1); zoStream.close(); } catch (SecurityException se) { logger.warning("Security Exception caught while creating " + zipFileName); |