|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.zip.ZipUnpacker
public class ZipUnpacker
This class can be used to unpack zip files into the BASE directory structure. The class supports unpacking multiple zip files in the same transaction.
Field Summary | |
---|---|
private DbControl |
dc
|
private Map<String,Directory> |
paths
Cache of directories. |
Constructor Summary | |
---|---|
ZipUnpacker(DbControl dc)
Create a new zip unpacker. |
Method Summary | |
---|---|
private Directory |
getDirectory(Path path)
Get the directory for the specified path. |
int |
unpackZipFile(Directory rootDir,
ZipInputStream zip,
boolean overwrite,
AbsoluteProgressReporter progress)
Unpack a zip file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DbControl dc
private Map<String,Directory> paths
Constructor Detail |
---|
public ZipUnpacker(DbControl dc)
dc
- The DbControl to use for database accessMethod Detail |
---|
public int unpackZipFile(Directory rootDir, ZipInputStream zip, 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 progress
IOException
- If there is an error when unpacking the zip file
BaseException
- If there is a BASE errorprivate Directory getDirectory(Path path)
path
- The path
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |