public class ZipUtils extends Object
| Constructor and Description |
|---|
ZipUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFromZip(Path source,
Path target) |
static FileSystem |
newFileSystem(Path path)
This call is thread safe, a new FS is created for each invocation.
|
static FileSystem |
newFileSystem(URI uri,
Map<String,?> env)
This call is not thread safe, a single of FileSystem can be created for the
profided uri until it is closed.
|
static FileSystem |
newZip(Path zipFile) |
static URI |
toZipUri(Path zipFile) |
static void |
unzip(Path zipFile,
Path targetDir) |
static OutputStream |
wrapForJDK8232879(OutputStream original)
This is a hack to get past the JDK-8232879
issue which causes CRC errors when writing out data to (jar) files using ZipFileSystem.
|
static void |
zip(Path src,
Path zipFile) |
public static void unzip(Path zipFile, Path targetDir) throws IOException
IOExceptionpublic static URI toZipUri(Path zipFile) throws IOException
IOExceptionpublic static void copyFromZip(Path source, Path target) throws IOException
IOExceptionpublic static void zip(Path src, Path zipFile) throws IOException
IOExceptionpublic static FileSystem newZip(Path zipFile) throws IOException
IOExceptionpublic static FileSystem newFileSystem(URI uri, Map<String,?> env) throws IOException
uri - The uri to the zip file.env - Env map.IOException - in case of a failurepublic static FileSystem newFileSystem(Path path) throws IOException
path - The zip file.IOException - in case of a failurepublic static OutputStream wrapForJDK8232879(OutputStream original)
original - The original outputstream which will be wrapped into a new outputstream
that delegates to this one.Copyright © 2021 JBoss by Red Hat. All rights reserved.