Lines 50-55
Link Here
|
50 |
import java.io.OutputStream; |
50 |
import java.io.OutputStream; |
51 |
import java.util.ArrayList; |
51 |
import java.util.ArrayList; |
52 |
import java.util.List; |
52 |
import java.util.List; |
|
|
53 |
import java.util.Set; |
53 |
import java.util.concurrent.ExecutionException; |
54 |
import java.util.concurrent.ExecutionException; |
54 |
import java.util.concurrent.TimeoutException; |
55 |
import java.util.concurrent.TimeoutException; |
55 |
import java.util.logging.Level; |
56 |
import java.util.logging.Level; |
Lines 400-406
Link Here
|
400 |
* @param dir the base directory in which to unpack (need not yet exist) |
401 |
* @param dir the base directory in which to unpack (need not yet exist) |
401 |
* @throws IOException in case of problems |
402 |
* @throws IOException in case of problems |
402 |
*/ |
403 |
*/ |
403 |
public static void unpackZipFile(InputStream zipStream, File dir) throws IOException { |
404 |
public static void unpackZipFile(InputStream zipStream, File dir, Set<File> createdDirs) throws IOException { |
404 |
byte[] buf = new byte[8192]; |
405 |
byte[] buf = new byte[8192]; |
405 |
ZipInputStream zis = new ZipInputStream(zipStream); |
406 |
ZipInputStream zis = new ZipInputStream(zipStream); |
406 |
ZipEntry entry; |
407 |
ZipEntry entry; |
Lines 412-417
Link Here
|
412 |
if (!baseDir.isDirectory() && !baseDir.mkdirs()) { |
413 |
if (!baseDir.isDirectory() && !baseDir.mkdirs()) { |
413 |
throw new IOException("could not make " + baseDir); // NOI18N |
414 |
throw new IOException("could not make " + baseDir); // NOI18N |
414 |
} |
415 |
} |
|
|
416 |
if (createdDirs != null) { |
417 |
createdDirs.add(baseDir); |
418 |
} |
415 |
} |
419 |
} |
416 |
if (slash != name.length() - 1) { |
420 |
if (slash != name.length() - 1) { |
417 |
File f = new File(dir, name.replace('/', File.separatorChar)); |
421 |
File f = new File(dir, name.replace('/', File.separatorChar)); |