Home | History | Annotate | Download | only in util

Lines Matching defs:zipFile

21 import org.apache.commons.compress.archivers.zip.ZipFile;
36 * @param entry the entry inside zipfile (potentially contains mode info)
53 * @param zipFile the {@link ZipFile} to extract
57 public static void extractZip(ZipFile zipFile, File destDir) throws IOException {
58 Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries();
68 FileUtil.writeToFile(zipFile.getInputStream(entry), childFile);
78 * @param zipFile a {@link File} pointing to a zip file.
82 public static void extractZip(File zipFile, File destDir) throws IOException {
83 try (ZipFile zip = new ZipFile(zipFile)) {
91 * @param zipFile the {@link ZipFile} to extract
96 public static File extractFileFromZip(ZipFile zipFile, String filePath) throws IOException {
97 ZipArchiveEntry entry = zipFile.getEntry(filePath);
103 FileUtil.writeToFile(zipFile.getInputStream(entry), createdFile);
111 * @param zipFile the zip file to extract
115 public static File extractZipToTemp(File zipFile, String nameHint) throws IOException {
117 try (ZipFile zip = new ZipFile(zipFile)) {
128 * Close an open {@link ZipFile}, ignoring any exceptions.
130 * @param zipFile the file to close
132 public static void closeZip(ZipFile zipFile) {
133 if (zipFile != null) {
135 zipFile.close();