Package java.util.zip

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


                zout.write(version.getBytes(), 0, version.getBytes().length);
               
                if (comment.length() > 0)
                    zout.write(("\n" + comment).getBytes(), 0, ("\n" + comment).getBytes().length);
               
                zout.closeEntry();
               
                for (String file : files) {
                    if (!file.endsWith(".log")) {
                        InputStream in = new FileInputStream(file);
                        ZipEntry e = new ZipEntry(file.replace(File.separatorChar, '/'));
View Full Code Here


                        }

                        listener.sendMessage(DcResources.getText("msgCreatingBackupOfFile", file));

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

                    listener.notifyProcessed();
                }
               
View Full Code Here

                buffer,
                0,
                n);
        }
        inputStream.close();
        zipOutputStream.closeEntry();
        zipOutputStream.close();
    }
}
View Full Code Here

      for (EncryptedTable table : getEncryptedTables(connection)) {
        ZipEntry entry = new ZipEntry(table.tableName + ".dat");
        zip.putNextEntry(entry);
        table.save(connection, writer);
        writer.flush();
        zip.closeEntry();
      }
      zip.flush();
      zip.close();
    } catch (Exception e) {
      if (zip != null) {
View Full Code Here

    byte[] buf = new byte[4096];
    int len;
    while ((len = in.read(buf)) > 0) {
      out.write(buf, 0, len);
    }
    out.closeEntry();
    in.close();
    out.close();
    return new File(outFilename);
  }
View Full Code Here

            ze.setCrc(crc.getValue());
            out.putNextEntry(ze);
            for (int i=0; i<mime.length(); i++) {
                out.write(mime.charAt(i));
            }
            out.closeEntry();

            ZipEntry zipEntry = new ZipEntry("content.xml");
            //zipEntry.setMethod(ZipEntry.DEFLATED);
            out.putNextEntry(zipEntry);
            int c = -1;
View Full Code Here

            out.putNextEntry(zipEntry);
            int c = -1;
            while ((c = source.read()) >= 0) {
                out.write(c);
            }
            out.closeEntry();

            // Add manifest (required for OOo 2.0), "meta.xml", "mimetype" files. These are in the
            // resource/openoffice directory, and are copied verbatim into the zip file.
            addResourceFile("meta.xml", "/resource/openoffice/meta.xml", out);
            addResourceFile("mimetype", "/resource/openoffice/mimetype", out);
View Full Code Here

        while ((entry = in.getNextEntry()) != null) {
          out.putNextEntry(entry);
          if (!entry.isDirectory()) {
                    StreamUtils.readTo(in, out, false, false);
                }
                out.closeEntry();
        }
        in.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
View Full Code Here

            inDocHandler.endElement("", "classes", "classes");
            inDocHandler.endDocument();
        }

        if (outRepresentation == SINGLE_XML) {
            zos.closeEntry();
        }
        zos.flush();
        zos.close();

        return i;
View Full Code Here

                    n = is.read(buf, 0, buf.length);
                    if (n != -1) {
                        out.write(buf, 0, n);
                    }
                } while (n != -1);
                out.closeEntry();
            }
            out.close();
            zf.close();
            if (!f.delete()) {
                throw new IOException("Cannot delete file " + f);
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.