public class ZipUnpacker extends Object
Modifier and Type | Field and Description |
---|---|
private DbControl |
dc |
private Map<String,Directory> |
paths
Cache of directories.
|
Constructor and Description |
---|
ZipUnpacker(DbControl dc)
Create a new zip unpacker.
|
Modifier and Type | Method and Description |
---|---|
private Directory |
getDirectory(Path path)
Get the directory for the specified path.
|
int |
unpackZipFile(Directory rootDir,
ZipInputStream zip,
File sourceFile,
boolean overwrite,
AbsoluteProgressReporter progress)
Unpack a zip file.
|
private final DbControl dc
public ZipUnpacker(DbControl dc)
dc
- The DbControl to use for database accesspublic int unpackZipFile(Directory rootDir, ZipInputStream zip, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws IOException, BaseException
rootDir
- The directory where the contents of the zip file should be placedzip
- The contents of the zip fileoverwrite
- If existing files should be overwritten or ignoredprogress
- An optional progress reporter for displaying progressIOException
- If there is an error when unpacking the zip fileBaseException
- If there is a BASE errorprivate Directory getDirectory(Path path)
path
- The path