Package java.util.zip

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


      in.close();
      out.closeEntry();
    }

    // Complete the ZIP file
    out.finish();
    out.close();
  }

  public static void zipDirectory(File fileZip, File directory)
     throws IOException
View Full Code Here


     throws IOException
  {
    byte[] buffer = new byte[BUFFER_SIZE];
    ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(fileZip));
    zip(directory, directory, zos, buffer);
    zos.finish();
    zos.close();
  }

  public static void zip(File directory, File base, ZipOutputStream zos, byte[] buffer)
     throws IOException
View Full Code Here

                    bufferStream.reset();
                }
                //end д����Ŀ��ͼ�ļ�

                zipOutStream.finish();
                zipOutStream.close();

            } catch (Exception exception) {
                System.out.println("Exception occurs when save current project.\n" + exception.getCause());
            }
View Full Code Here

          bufferStream.reset();
        }
        // gh end
        // end д�붨����Ϣ

        zipOutStream.finish();
        zipOutStream.close();

      } catch (Exception exception) {
        System.out
            .println("Exception occurs when save current project.\n"
View Full Code Here

                    bufferStream.reset();
                }
                //end д����Ŀ��ͼ�ļ�

                zipOutStream.finish();
                zipOutStream.close();

            } catch (Exception exception) {
                System.out.println("Exception occurs when save current project.\n" + exception.getCause());
            }
View Full Code Here

                  bufferStream.reset();
                }
                //gh end
                //end д�붨����Ϣ

                zipOutStream.finish();
                zipOutStream.close();

            } catch (Exception exception) {
                System.out.println("Exception occurs when save current project.\n" + exception);
            }
View Full Code Here

        } catch (Exception e) {
            log.error("Unknown exception: ", e);
        } finally {
            try {
                if (filesSent >= 1)
                    zout.finish();
            } catch (IOException e) {
                log.warn("IOException occurred when finishing the ZipOutputStream.");
            }
            IOUtils.closeQuietly(output);
            IOUtils.closeQuietly(zout);
View Full Code Here

      }               
      FileOutputStream fos = new FileOutputStream(zipFileName.toString());     
      ZipOutputStream cpZipOutputStream = new ZipOutputStream(fos);         
      cpZipOutputStream.setLevel(9);         
      zipFiles(cpZipOutputStream, cpFile, dirName.toString());         
      cpZipOutputStream.finish();         
      cpZipOutputStream.close();       

    }
    catch (Exception e) {
      printError(ZIPSEND,"Problem processing ZIPCREATE_LOCAL command ("+e.toString()+") :",currToken);
View Full Code Here

    zoutp.putNextEntry(new ZipEntry("zippedfile"));
    while((byteCount = inIPS.read(data,0,ZIP_BUFFER)) != -1 ) {
      zoutp.write(data,0,byteCount);
                        initialContentLength += byteCount;
    }
    zoutp.finish();
    zoutp.flush();
    zoutp.close();
    baos.flush();
    baos.close();
    contentLength = (long)baos.size();
View Full Code Here

        zos.finish();
        assertEquals("Finish failed to closeCurrentEntry", 11, ze.getSize());

        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) {
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.