Package com.intellij.util.io
Class ZipUtil
- java.lang.Object
-
- com.intellij.util.io.ZipUtil
-
public class ZipUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
addDirToZipRecursively(ZipOutputStream outputStream, File jarFile, File dir, String relativePath, FileFilter fileFilter, Set<String> writtenItemRelativePaths)
static boolean
addFileOrDirRecursively(ZipOutputStream jarOutputStream, File jarFile, File file, String relativePath, FileFilter fileFilter, Set<String> writtenItemRelativePaths)
static boolean
addFileToZip(ZipOutputStream zos, File file, String relativeName, Set<String> writtenItemRelativePaths, FileFilter fileFilter)
static void
extract(File file, File outputDir, FilenameFilter filenameFilter)
static void
extract(File file, File outputDir, FilenameFilter filenameFilter, boolean overwrite)
static void
extract(ZipFile zipFile, File outputDir, FilenameFilter filenameFilter)
static void
extract(ZipFile zipFile, File outputDir, FilenameFilter filenameFilter, boolean overwrite)
static void
extractEntry(ZipEntry entry, InputStream inputStream, File outputDir)
static void
extractEntry(ZipEntry entry, InputStream inputStream, File outputDir, boolean overwrite)
static boolean
isZipContainsEntry(File zip, String relativePath)
static boolean
isZipContainsFolder(File zip)
static void
update(InputStream in, OutputStream out, Map<String,File> relpathToFile)
-
-
-
Method Detail
-
addFileToZip
public static boolean addFileToZip(@NotNull ZipOutputStream zos, @NotNull File file, @NotNull String relativeName, @Nullable Set<String> writtenItemRelativePaths, @Nullable FileFilter fileFilter) throws IOException
- Throws:
IOException
-
addFileOrDirRecursively
public static boolean addFileOrDirRecursively(@NotNull ZipOutputStream jarOutputStream, @NotNull File jarFile, @NotNull File file, @NotNull String relativePath, @Nullable FileFilter fileFilter, @Nullable Set<String> writtenItemRelativePaths) throws IOException
- Throws:
IOException
-
addDirToZipRecursively
public static boolean addDirToZipRecursively(@NotNull ZipOutputStream outputStream, @NotNull File jarFile, @NotNull File dir, @NotNull String relativePath, @Nullable FileFilter fileFilter, @Nullable Set<String> writtenItemRelativePaths) throws IOException
- Throws:
IOException
-
extract
public static void extract(@NotNull File file, @NotNull File outputDir, @Nullable FilenameFilter filenameFilter) throws IOException
- Throws:
IOException
-
extract
public static void extract(@NotNull File file, @NotNull File outputDir, @Nullable FilenameFilter filenameFilter, boolean overwrite) throws IOException
- Throws:
IOException
-
extract
public static void extract(@NotNull ZipFile zipFile, @NotNull File outputDir, @Nullable FilenameFilter filenameFilter) throws IOException
- Throws:
IOException
-
extract
public static void extract(@NotNull ZipFile zipFile, @NotNull File outputDir, @Nullable FilenameFilter filenameFilter, boolean overwrite) throws IOException
- Throws:
IOException
-
extractEntry
public static void extractEntry(ZipEntry entry, InputStream inputStream, File outputDir) throws IOException
- Throws:
IOException
-
extractEntry
public static void extractEntry(ZipEntry entry, InputStream inputStream, File outputDir, boolean overwrite) throws IOException
- Throws:
IOException
-
isZipContainsFolder
public static boolean isZipContainsFolder(File zip) throws IOException
- Throws:
IOException
-
isZipContainsEntry
public static boolean isZipContainsEntry(File zip, String relativePath) throws IOException
- Throws:
IOException
-
update
public static void update(InputStream in, OutputStream out, Map<String,File> relpathToFile) throws IOException
- Throws:
IOException
-
-