Package java.util.zip

Examples of java.util.zip.ZipOutputStream.finish()


               zos.closeEntry();
            }
         }
         zos.flush();
         zos.finish();
      }
      catch (Throwable t)
      {
         throw new BindingException("Exception writing data to zip.", t);
      }
View Full Code Here


        final ZipOutputStream gzos = new ZipOutputStream(baos);
        gzos.setMethod(ZipOutputStream.DEFLATED);
        gzos.putNextEntry(new ZipEntry(length + ""));
        gzos.write(whatToCompress, 0, length);
        gzos.closeEntry();
        gzos.finish();
        gzos.close();
        return baos.toByteArray();
    }
   
    /**
 
View Full Code Here

        zout.setMethod(ZipOutputStream.DEFLATED);
        try {
            int pos = contentNode.getPath().length();
            exportZipEntry(context, zout, contentNode, pos > 1 ? pos+1 : pos);
        } finally {
            zout.finish();
        }
    }

    /**
     * If the specified node is the defined non-collection nodetype a new
View Full Code Here

      out = new ZipOutputStream(fos);
          for (int i = 0; i < files.length; i++) {
            addEntry(out, files[i]);
          }
          out.flush();
          out.finish();
    } finally {
      if (out != null) out.close();
      if (fos != null) fos.close();
      logger.debug("OUT");
    }
View Full Code Here

    writeFgNodes(diff.getFgNodesOnlyIn2(), naturalizer, zipOut);

    zipOut.putNextEntry(new ZipEntry("diff-readme.txt"));
    zipOut.write("this is a diff of two rdf-graphs\n".getBytes());
    zipOut.flush();
    zipOut.finish();
  }

  /**
   * @param fgNodesOnlyIn1
   * @param string
View Full Code Here

        jarStream.write( fileData );
        jarStream.closeEntry();
      }
    }
    finally {
      jarStream.finish();
    }
  }

}
View Full Code Here

        log.debug("Starting to process export");
        ZipOutputStream zout = new ZipOutputStream(res.getOutputStream());
        zout.putNextEntry(new ZipEntry("repository_export.xml"));
        fileManagerService.exportRulesRepository(zout);
        zout.closeEntry();
        zout.finish();
        res.getOutputStream().flush();
        log.debug("Done exporting!");
    }

    private void processExportPackageFromRepositoryDownload(
View Full Code Here

        if (inPlaceConfUtil.isInPlaceConfiguration(dir)) {
            dir = inPlaceConfUtil.readInPlaceLocation(dir);
            writeToZip(dir, out, "", buf);
        }
        out.closeEntry();
        out.finish();
        out.flush();
    }

    private void writeToZip(File dir, ZipOutputStream out, String prefix, byte[] buf) throws IOException {
      if (dir.isDirectory()) {
View Full Code Here

          zipOutputStream.write(content, offset, length);
        } finally {
          zipOutputStream.closeEntry();
        }

        zipOutputStream.finish();
        result = memoryOutputStream.toByteArray();
      } finally {
        zipOutputStream.close();
      }
View Full Code Here

        ZipOutputStream zip = new ZipOutputStream(out);
        try {
            zip.putNextEntry(new ZipEntry("z"));
            getWrapped().serialize(obj, type, zip);
            zip.closeEntry();
            zip.finish();
            zip.flush();
        } finally {
            if (isCloseEnabled()) {
                zip.close();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.