|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.entityfs.util.AbstractIteratorUtil org.entityfs.util.zip.AbstractZipCreator<ZipCreator> org.entityfs.util.zip.ZipCreator
public class ZipCreator
The ZipCreator
creates a Zip archive using ZipEntryInfo
objects returned from an iterator. An
EntityIteratorToZipEntryInfoIteratorAdapter
can be used to create
ZipEntryInfo
objects from entities returned from an entity iterator.
The ZipCreator
will lock files for reading as their contents are
copied to the Zip archive.
After creating a ZipCreator
object, various Zip file properties can
be set using the object's setter methods.
If no data is returned from the iterator, the Zip file is not created at all.
If you just want to create a Zip file containing the contents of a directory
hierarchy, the ZipFiles.zip(DirectoryView, DirectoryView, String)
method is easier to use than this object.
This class uses Java's ZipOutputStream
for creating the
Zip file. For more flexibility in the Zip file contents, use the Zip builder
from the At4J project instead.
CompoundZipEntryInfoProvider
,
ZipFiles.unzip(org.entityfs.ReadableFile, DirectoryView)
,
ZipFiles.zip(DirectoryView, DirectoryView, String)
Constructor Summary | |
---|---|
ZipCreator(Iterator<? extends ZipEntryInfo> itr,
DirectoryView targetDirectory,
String targetFileName)
Create a ZipCreator that uses the default
ErrorHandlingStrategy . |
|
ZipCreator(Iterator<? extends ZipEntryInfo> itr,
DirectoryView targetDirectory,
String targetFileName,
ErrorHandlingStrategy ehs)
Create a ZipCreator that uses the supplied
ErrorHandlingStrategy . |
Method Summary |
---|
Methods inherited from class org.entityfs.util.zip.AbstractZipCreator |
---|
create, create, createOutputStream, createTargetFile, getTargetDirectory, getTargetFileName, getThis, setComment, setLevel, setMethod |
Methods inherited from class org.entityfs.util.AbstractIteratorUtil |
---|
letErrorStrategyHandle, letErrorStrategyHandle, letErrorStrategyHandle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZipCreator(Iterator<? extends ZipEntryInfo> itr, DirectoryView targetDirectory, String targetFileName)
ZipCreator
that uses the default
ErrorHandlingStrategy
.
itr
- The iterator to get ZipEntryInfo
objects from.targetDirectory
- The directory where the Zip file will be created.targetFileName
- The name of the Zip file.public ZipCreator(Iterator<? extends ZipEntryInfo> itr, DirectoryView targetDirectory, String targetFileName, ErrorHandlingStrategy ehs)
ZipCreator
that uses the supplied
ErrorHandlingStrategy
.
itr
- The iterator to get ZipEntryInfo
objects from.targetDirectory
- The directory where the Zip file will be created.targetFileName
- The name of the Zip file.ehs
- The error handling strategy.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |