Java Utililty Methods FileOutputStream Write

List of utility methods to do FileOutputStream Write

Description

The list of methods to do FileOutputStream Write are organized into topic(s).

Method

voidsaveZipFile(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);