import java.net.URL;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
extractZip(fis, dst);
}
}
-
+
+ public static void extractZip(File zipFile, File dst, Charset charset) throws IOException {
+ if (LOGGER.isTraceEnabled())
+ LOGGER.trace("Extracting zip "+zipFile);
+ try (FileInputStream fis = new FileInputStream(zipFile)) {
+ extractZip(fis, dst, charset);
+ }
+ }
/**
* Extract a zip file into a directory
*
* @throws IOException
*/
public static void extractZip(InputStream zipInput, File dst) throws IOException {
+ extractZip(zipInput, dst, StandardCharsets.UTF_8);
+ }
+
+ public static void extractZip(InputStream zipInput, File dst, Charset charset) throws IOException {
byte[] buf = new byte[8192];
- ZipInputStream zis = new ZipInputStream(zipInput);
+ ZipInputStream zis = new ZipInputStream(zipInput, charset);
ZipEntry entry;
entry = zis.getNextEntry();