Codota Logo
ZipUtil.addEntry
Code IndexAdd Codota to your IDE (free)

How to use
addEntry
method
in
org.zeroturnaround.zip.ZipUtil

Best Java code snippets using org.zeroturnaround.zip.ZipUtil.addEntry (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, bytes, tmpFile, compressionMethod);
  return true;
 }
});
origin: zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, entry, tmpFile);
  return true;
 }
});
origin: zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, file, tmpFile);
  return true;
 }
});
origin: zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, bytes, tmpFile);
  return true;
 }
});
origin: zeroturnaround/zt-zip

/**
 * 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);
}
origin: zeroturnaround/zt-zip

/**
 * 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);
}
origin: zeroturnaround/zt-zip

/**
 * 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);
}
origin: zeroturnaround/zt-zip

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);
 }
}
origin: zeroturnaround/zt-zip

/**
 * 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);
 }
}
origin: zeroturnaround/zt-zip

/**
 * 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);
 }
}
origin: zeroturnaround/zt-zip

addEntry(zipEntrySource, out);
origin: org.zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, entry, tmpFile);
  return true;
 }
});
origin: org.zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, file, tmpFile);
  return true;
 }
});
origin: org.zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, bytes, tmpFile, compressionMethod);
  return true;
 }
});
origin: org.zeroturnaround/zt-zip

 public boolean act(File tmpFile) {
  addEntry(zip, path, bytes, tmpFile);
  return true;
 }
});
origin: org.zeroturnaround/zt-zip

/**
 * 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);
}
origin: org.zeroturnaround/zt-zip

/**
 * 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);
}
origin: org.zeroturnaround/zt-zip

/**
 * 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);
}
origin: org.zeroturnaround/zt-zip

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);
 }
}
origin: org.zeroturnaround/zt-zip

/**
 * 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);
 }
}
org.zeroturnaround.zipZipUtiladdEntry

Javadoc

Changes a zip file, adds one new entry in-place.

Popular methods of ZipUtil

  • pack
  • unpack
    Unpacks a ZIP stream to the given directory. The output directory must not be a file.
  • unpackEntry
    Unpacks a single file from a ZIP archive to a file.
  • removeEntry
    Copies an existing ZIP file and removes entry with a given path.
  • iterate
    Reads the given ZIP stream and executes the given action for each given entry. For each given entry
  • containsEntry
    Checks if the ZIP file contains the given entry.
  • addOrReplaceEntries
    Copies an existing ZIP file and adds/replaces the given entries in it.
  • packEntries
    Compresses the given files into a ZIP file. The ZIP file must not be a directory and its parent dire
  • removeEntries
    Copies an existing ZIP file and removes entries with given paths.
  • repack
    Repacks a provided ZIP input stream into a ZIP file with a given compression level.
  • replaceEntry
    Copies an existing ZIP file and replaces a given entry in it.
  • unexplode
    Compresses a given directory in its own location. A ZIP file will be first created with a temporary
  • replaceEntry,
  • unexplode,
  • unwrap,
  • addEntries,
  • archiveEqualsInternal,
  • checkDestinationFileForTraversal,
  • closeQuietly,
  • copyEntries,
  • doEntryEquals

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • orElseThrow (Optional)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now