Package org.apache.commons.compress.archivers.zip

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


        entry.setTime(modified);
        zos.putArchiveEntry(entry);

        ObjectLoader ldr = repository.open(id);
        ldr.copyTo(zos);
        zos.closeArchiveEntry();
      }
      zos.finish();
      success = true;
    } catch (IOException e) {
      error(e, repository, "{0} failed to zip files from commit {1}", commit.getName());
View Full Code Here


        pyEntry.setSize(pyBytes.length);
        pyEntry.setUnixMode(FileMode.EXECUTABLE_FILE.getBits());
        pyEntry.setTime(lastModified);
        zos.putArchiveEntry(pyEntry);
        zos.write(pyBytes);
        zos.closeArchiveEntry();

        // add a Python launch cmd file
        byte [] cmdBytes = readAll(getClass().getResourceAsStream("/pt.cmd"));
        ZipArchiveEntry cmdEntry = new ZipArchiveEntry("pt.cmd");
        cmdEntry.setSize(cmdBytes.length);
View Full Code Here

        cmdEntry.setSize(cmdBytes.length);
        cmdEntry.setUnixMode(FileMode.REGULAR_FILE.getBits());
        cmdEntry.setTime(lastModified);
        zos.putArchiveEntry(cmdEntry);
        zos.write(cmdBytes);
        zos.closeArchiveEntry();

        // add a brief readme
        byte [] txtBytes = readAll(getClass().getResourceAsStream("/pt.txt"));
        ZipArchiveEntry txtEntry = new ZipArchiveEntry("readme.txt");
        txtEntry.setSize(txtBytes.length);
View Full Code Here

        txtEntry.setSize(txtBytes.length);
        txtEntry.setUnixMode(FileMode.REGULAR_FILE.getBits());
        txtEntry.setTime(lastModified);
        zos.putArchiveEntry(txtEntry);
        zos.write(txtBytes);
        zos.closeArchiveEntry();

        // cleanup
        zos.finish();
        zos.close();
        os.flush();
View Full Code Here

        entry.setTime(modified);
        zos.putArchiveEntry(entry);

        ObjectLoader ldr = repository.open(id);
        ldr.copyTo(zos);
        zos.closeArchiveEntry();
      }
      zos.finish();
      success = true;
    } catch (IOException e) {
      error(e, repository, "{0} failed to zip files from commit {1}", commit.getName());
View Full Code Here

            zos.write(buf, 0, length);
          }
        } finally {
          IOUtils.closeQuietly(fis);
        }
        zos.closeArchiveEntry();
      }
    }
    zos.close();
  }
View Full Code Here

            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

            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

            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

            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.