public class ZipTools extends Object
Constructor and Description |
---|
ZipTools() |
Modifier and Type | Method and Description |
---|---|
static void |
addToZip(ZipOutputStream zos,
String filename,
String nameInArchive) |
static void |
copyInputStream(InputStream in,
OutputStream out) |
static void |
forceParentDirectories(String filename) |
static void |
unzip(String zipfileName,
String baseOutputDir)
It is HIGHLY recommended to use a baseOutputDir, such as "./", or
a local directory you know, such as "/tmp/foo", to prevent
files from being unzipped in your root directory.
|
static void |
zipDir(int stripLeadingPathChars,
String dir2zip,
ZipOutputStream zos) |
static void |
zipDiveDirectory(int stripLeadingPathChars,
String directory,
String zipFilename) |
public static final void copyInputStream(InputStream in, OutputStream out) throws IOException
IOException
public static void forceParentDirectories(String filename) throws Exception
Exception
public static final void unzip(String zipfileName, String baseOutputDir)
public static void zipDiveDirectory(int stripLeadingPathChars, String directory, String zipFilename) throws Exception
Exception
public static void zipDir(int stripLeadingPathChars, String dir2zip, ZipOutputStream zos) throws Exception
Exception
public static void addToZip(ZipOutputStream zos, String filename, String nameInArchive) throws Exception
Exception
Copyright © 2016. All rights reserved.