public class ZipUtils extends Object
Modifier and Type | Method and Description |
---|---|
static File |
createArchive(File source) |
static File |
createArchive(File source,
File destination) |
static File |
createArchive(File source,
File destination,
boolean overwrite) |
static File |
createArchive(String source) |
static File |
createArchive(String source,
String destination) |
static File |
createArchive(String source,
String destination,
boolean overwrite) |
static void |
unzip(File source,
File destination) |
static void |
unzip(File source,
File destination,
boolean preventDirectoryTraversalCharacters)
Unzip source zip file into target destination.
|
public static File createArchive(File source) throws IOException
IOException
public static File createArchive(String source) throws IOException
IOException
public static File createArchive(File source, File destination) throws IOException
IOException
public static File createArchive(String source, String destination) throws IOException
IOException
public static File createArchive(File source, File destination, boolean overwrite) throws IOException
IOException
public static File createArchive(String source, String destination, boolean overwrite) throws IOException
IOException
public static void unzip(File source, File destination) throws IOException
IOException
public static void unzip(File source, File destination, boolean preventDirectoryTraversalCharacters) throws IOException
source
- source zip filedestination
- target destinationpreventDirectoryTraversalCharacters
- check whether internal zip files contain directory traversal
characters. If so then throw exception as it's security violationIOException
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries