public final class IOUtil extends Object
The GNU Lesser General Public License for details.
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log
The log stream
|
Modifier | Constructor and Description |
---|---|
private |
IOUtil()
Prevent instantiation
|
Modifier and Type | Method and Description |
---|---|
static void |
close(Closeable closeable)
Closes any
Closeable object |
static byte[] |
getZipEntry(String entrySpec)
Get a zip entry by specification, returning a buffer of the contents.
|
static void |
unpackZip(File file,
File destdir)
Unpack a zip file to a given directory.
|
static void |
unpackZip(File file,
File destdir,
boolean include,
String... includeExcludes)
Unpack a zip file to a given directory.
|
public static void unpackZip(File file, File destdir) throws IOException
file
- The zip file to downloaddestdir
- The directory to unpack upIOException
- If there is an file errorpublic static void unpackZip(File file, File destdir, boolean include, String... includeExcludes) throws IOException
file
- The zip file to downloaddestdir
- The directory to unpack upinclude
- true to indicate the next arguments will be a filter that only includes what is specified.includeExcludes
- a list of case insensitive patterns that will act as an inclusion or exclusion prefixIOException
- If there is an file errorpublic static byte[] getZipEntry(String entrySpec) throws IOException
entrySpec
- This is of the form /path/to/zip!entryNameIOException