Examples of closeArchiveEntry()


Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

        ZipArchiveEntry entry = new ZipArchiveEntry(entryName);
        zos.putArchiveEntry(entry);
        FileInputStream fis = new FileInputStream(fileName);
        IOUtils.copy(fis, zos);
        fis.close();
        zos.closeArchiveEntry();
      }
      zos.close();
      return new File(zipPath);
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

    newZipStream.putArchiveEntry(zipEntry);
    FileInputStream currentFileStream = new FileInputStream(fileToZip);
    while ((bytesRead = currentFileStream.read(buffer))!= -1) {
      newZipStream.write(buffer, 0, bytesRead);
    }
    newZipStream.closeArchiveEntry();
    newZipStream.close();
    currentFileStream.close();
    logger.info("Deleting: " + fileToZip.getName());
    fileToZip.delete();
    return zipFile;
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

            ZipArchiveEntry zipEntry = new ZipArchiveEntry(entryName);
            newZipStream.putArchiveEntry(zipEntry);
            while ((bytesRead = currentFileStream.read(buffer))!= -1) {
              newZipStream.write(buffer, 0, bytesRead);
            }
            newZipStream.closeArchiveEntry();
          } else {
            logger.debug("Adding entries from compressed file...");
            //read the entries from the zip file and copy them to the new zip archive
            //so that we don't have to recompress them.
            ZipArchiveInputStream currentZipStream = new ZipArchiveInputStream(currentFileStream);
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

              }
              int bytesRead;
              while ((bytesRead = currentZipStream.read(buffer))!= -1) {
                newZipStream.write(buffer, 0, bytesRead);
                    }
              newZipStream.closeArchiveEntry();
            }
            currentZipStream.close();
         
        } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

            archive.deleteOnExit();
            zos = new ZipArchiveOutputStream(archive);
            long beforeArchiveWrite = tmp[0].lastModified();
            ZipArchiveEntry in = new ZipArchiveEntry(tmp[0], "foo");
            zos.putArchiveEntry(in);
            zos.closeArchiveEntry();
            zos.close();
            zos = null;
            zf = new ZipFile(archive);
            ZipArchiveEntry out = zf.getEntry("foo/");
            assertNotNull(out);
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

            zos = new ZipArchiveOutputStream(archive);
            long beforeArchiveWrite = tmp[0].lastModified();
            ZipArchiveEntry in = new ZipArchiveEntry("foo/");
            in.setTime(beforeArchiveWrite);
            zos.putArchiveEntry(in);
            zos.closeArchiveEntry();
            zos.close();
            zos = null;
            zf = new ZipFile(archive);
            ZipArchiveEntry out = zf.getEntry("foo/");
            assertNotNull(out);
View Full Code Here

Examples of org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry()

            while (fis.read(b) > 0) {
                zos.write(b);
            }
            fis.close();
            fis = null;
            zos.closeArchiveEntry();
            zos.close();
            zos = null;
            zf = new ZipFile(archive);
            ZipArchiveEntry out = zf.getEntry("foo");
            assertNotNull(out);
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.