public boolean act(File tmpFile) { addEntry(zip, path, bytes, tmpFile, compressionMethod); return true; } });
public boolean act(File tmpFile) { addEntry(zip, entry, tmpFile); return true; } });
public boolean act(File tmpFile) { addEntry(zip, path, file, tmpFile); return true; } });
public boolean act(File tmpFile) { addEntry(zip, path, bytes, tmpFile); return true; } });
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param file * new entry to be added. * @param destZip * new ZIP file created. */ public static void addEntry(File zip, String path, File file, File destZip) { addEntry(zip, new FileSource(path, file), destZip); }
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param bytes * new entry bytes (or <code>null</code> if directory). * @param destZip * new ZIP file created. * @param compressionMethod * the new compression method (<code>ZipEntry.STORED</code> or <code>ZipEntry.DEFLATED</code>). */ public static void addEntry(File zip, String path, byte[] bytes, File destZip, final int compressionMethod) { addEntry(zip, new ByteSource(path, bytes, compressionMethod), destZip); }
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param bytes * new entry bytes (or <code>null</code> if directory). * @param destZip * new ZIP file created. */ public static void addEntry(File zip, String path, byte[] bytes, File destZip) { addEntry(zip, new ByteSource(path, bytes), destZip); }
private static void pack(ZipEntrySource[] entries, OutputStream os, boolean closeStream) { try { ZipOutputStream out = new ZipOutputStream(os); for (int i = 0; i < entries.length; i++) { addEntry(entries[i], out); } out.flush(); out.finish(); if (closeStream) { out.close(); } } catch (IOException e) { throw ZipExceptionUtil.rethrow(e); } }
/** * Copies an existing ZIP file and appends it with new entries. * * @param zip * an existing ZIP file (only read). * @param entries * new ZIP entries appended. * @param destOut * new ZIP destination output stream */ public static void addEntries(File zip, ZipEntrySource[] entries, OutputStream destOut) { if (log.isDebugEnabled()) { log.debug("Copying '" + zip + "' to a stream and adding " + Arrays.asList(entries) + "."); } ZipOutputStream out = null; try { out = new ZipOutputStream(destOut); copyEntries(zip, out); for (int i = 0; i < entries.length; i++) { addEntry(entries[i], out); } out.finish(); } catch (IOException e) { ZipExceptionUtil.rethrow(e); } }
/** * Copies an existing ZIP file and appends it with new entries. * * @param is * an existing ZIP input stream. * @param entries * new ZIP entries appended. * @param destOut * new ZIP destination output stream * * @since 1.9 */ public static void addEntries(InputStream is, ZipEntrySource[] entries, OutputStream destOut) { if (log.isDebugEnabled()) { log.debug("Copying input stream to an output stream and adding " + Arrays.asList(entries) + "."); } ZipOutputStream out = null; try { out = new ZipOutputStream(destOut); copyEntries(is, out); for (int i = 0; i < entries.length; i++) { addEntry(entries[i], out); } out.finish(); } catch (IOException e) { ZipExceptionUtil.rethrow(e); } }
addEntry(zipEntrySource, out);
public boolean act(File tmpFile) { addEntry(zip, entry, tmpFile); return true; } });
public boolean act(File tmpFile) { addEntry(zip, path, file, tmpFile); return true; } });
public boolean act(File tmpFile) { addEntry(zip, path, bytes, tmpFile, compressionMethod); return true; } });
public boolean act(File tmpFile) { addEntry(zip, path, bytes, tmpFile); return true; } });
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param file * new entry to be added. * @param destZip * new ZIP file created. */ public static void addEntry(File zip, String path, File file, File destZip) { addEntry(zip, new FileSource(path, file), destZip); }
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param bytes * new entry bytes (or <code>null</code> if directory). * @param destZip * new ZIP file created. */ public static void addEntry(File zip, String path, byte[] bytes, File destZip) { addEntry(zip, new ByteSource(path, bytes), destZip); }
/** * Copies an existing ZIP file and appends it with one new entry. * * @param zip * an existing ZIP file (only read). * @param path * new ZIP entry path. * @param bytes * new entry bytes (or <code>null</code> if directory). * @param destZip * new ZIP file created. * @param compressionMethod * the new compression method (<code>ZipEntry.STORED</code> or <code>ZipEntry.DEFLATED</code>). */ public static void addEntry(File zip, String path, byte[] bytes, File destZip, final int compressionMethod) { addEntry(zip, new ByteSource(path, bytes, compressionMethod), destZip); }
private static void pack(ZipEntrySource[] entries, OutputStream os, boolean closeStream) { try { ZipOutputStream out = new ZipOutputStream(os); for (int i = 0; i < entries.length; i++) { addEntry(entries[i], out); } out.flush(); out.finish(); if (closeStream) { out.close(); } } catch (IOException e) { throw ZipExceptionUtil.rethrow(e); } }
/** * Copies an existing ZIP file and appends it with new entries. * * @param zip * an existing ZIP file (only read). * @param entries * new ZIP entries appended. * @param destOut * new ZIP destination output stream */ public static void addEntries(File zip, ZipEntrySource[] entries, OutputStream destOut) { if (log.isDebugEnabled()) { log.debug("Copying '" + zip + "' to a stream and adding " + Arrays.asList(entries) + "."); } ZipOutputStream out = null; try { out = new ZipOutputStream(destOut); copyEntries(zip, out); for (int i = 0; i < entries.length; i++) { addEntry(entries[i], out); } out.finish(); } catch (IOException e) { ZipExceptionUtil.rethrow(e); } }