Package java.util.zip

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


        ZipOutputStream zos = new ZipOutputStream(new ByteArrayOutputStream());
        zos.putNextEntry(new ZipEntry("myFile"));
        zos.finish();
        zos.close();
        try {
            zos.finish();
            fail("Assert 0: Expected IOException");
        } catch (IOException e) {
            // Expected
        }
    }
View Full Code Here


    ZipOutputStream zoutp = new ZipOutputStream(baos);
    zoutp.putNextEntry(new ZipEntry("zippedfile"));
    while((byteCount = inIPS.read(data,0,ZIP_BUFFER)) != -1 ) {
      zoutp.write(data,0,byteCount);
    }
    zoutp.finish();
    zoutp.flush();
    zoutp.close();
    baos.flush();
    baos.close();
    contentLength = (long)baos.size();
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 {
        File[] all = dir.listFiles();
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 {
        File[] all = dir.listFiles();
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 {
        File[] all = dir.listFiles();
View Full Code Here

            getGenerator().closeSession();

            // ����zip�ļ��������ر���
            if (zos != null) {
                try {
                    zos.finish();
                } catch (IOException e) {
                }
            }

            // �������������ɵ�ǰentry���Դ򿪵ģ��Źر���
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

        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 {
        File[] all = dir.listFiles();
View Full Code Here

  public static void writeAsZip(final OutputStream outputStream,
                           final Repository repository) throws IOException, ContentIOException
  {
    final ZipOutputStream zipout = new ZipOutputStream(outputStream);
    writeToZipStream(zipout, repository);
    zipout.finish();
    zipout.flush();
  }

  /**
   * Writes the given repository to the given ZIP-output stream.
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 {
        File[] all = dir.listFiles();
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.