Package java.util.zip

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


            ZipEntry ie = new ZipEntry(dir+"/resources/"+relUrl);
            u.p("entry = " + ie.getName());
            out.putNextEntry(ie);
            ImageIO.write(img,"png",out);
            out.flush();
            out.closeEntry();
        }
        out.close();
    }

View Full Code Here


                FileInputStream in = new FileInputStream(file);
                int len;
                while ((len = in.read(buf)) > 0)
                    out.write(buf, 0, len);
                in.close();
                out.closeEntry();
            }
        } finally {
            out.close();
        }
    }
View Full Code Here

        for (int i = 0; i < files.length; i++) {
            if (!files[i].isDirectory()) {
                ZipEntry entry = new ZipEntry(files[i].getName());
                zip.putNextEntry(entry);
                read(files[i],zip);
                zip.closeEntry();
            }
        }

        zip.finish();
        zip.flush();
View Full Code Here

        writeToZip(dir, out, "", buf);
        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 {
View Full Code Here

                out.write(i);
            }

            // Complete the entry
            in.close();
            out.closeEntry();
        }

        for (Map.Entry<String, String> entry : entries.entrySet()) {

            out.putNextEntry(new ZipEntry(entry.getKey()));
View Full Code Here

                out.write(i);
            }

            // Complete the entry
            in.close();
            out.closeEntry();
        }

        for (Map.Entry<String, String> entry : entries.entrySet()) {

            out.putNextEntry(new ZipEntry(entry.getKey()));
View Full Code Here

            while ((i = in.read()) != -1) {
                out.write(i);
            }

            // Complete the entry
            out.closeEntry();
        }

        for (Map.Entry<String, String> entry : entries.entrySet()) {

            out.putNextEntry(new ZipEntry(entry.getKey()));
View Full Code Here

          break;
        } else {
          zos.write(buff, 0, resultRead);
        }
      }
      zos.closeEntry();
    } catch (IOException ioe) {
      logger.log(POILogger.ERROR, "Cannot write: " + CONTENT_TYPES_PART_NAME
          + " in Zip !", ioe);
      return false;
    }
View Full Code Here

          // End of file reached
          break;
        }
        zos.write(buff, 0, resultRead);
      }
      zos.closeEntry();
    } catch (IOException ioe) {
      logger.log(POILogger.ERROR,"Cannot write: " + part.getPartName() + ": in ZIP",
          ioe);
      return false;
    }
View Full Code Here

            InputStream in = new FileInputStream(files[i]);
            out.putNextEntry(new ZipEntry(files[i].getName()));
            for (int read = in.read(buffer); read > -1; read = in.read(buffer)) {
                out.write(buffer, 0, read);
            }
            out.closeEntry();
            in.close();
        }

        for (ZipEntry ze = zin.getNextEntry(); ze != null; ze = zin.getNextEntry()) {
            out.putNextEntry(ze);
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.