|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.util.AbstractIteratorUtil
org.entityfs.util.zip.AbstractZipCreator<JarCreator>
org.entityfs.util.jar.JarCreator
public class JarCreator
The JarCreator
creates a Jar archive using ZipEntryInfo
objects returned from an iterator. An
EntityIteratorToJarEntryInfoIteratorAdapter
can be used to create
ZipEntryInfo
objects from entities returned from an entity iterator.
The JarCreator
will lock files for reading as their contents are
copied to the Jar archive.
After creating a JarCreator
object, various Jar file properties can
be set using the object's setter methods.
If no data is returned from the iterator, the Jar file is not created at all.
If a META-INF/MANIFEST.MF
file is copied from the sources, it is used
as the manifest file of the Jar, unless another manifest is set with the
setManifest(Manifest)
method.
Constructor Summary | |
---|---|
JarCreator(Iterator<? extends ZipEntryInfo> itr,
DirectoryView targetDir,
String targetFileName)
Create a JarCreator that uses the default
ErrorHandlingStrategy . |
|
JarCreator(Iterator<? extends ZipEntryInfo> itr,
DirectoryView targetDir,
String targetFileName,
ErrorHandlingStrategy ehs)
Create a JarCreator that uses the provided
ErrorHandlingStrategy . |
Method Summary | |
---|---|
protected ZipOutputStream |
createOutputStream(WritableFile f)
Override the inherited method to open a JarOutputStream instead. |
Manifest |
getManifest()
|
JarCreator |
setManifest(Manifest mf)
Set the Jar file's manifest. |
Methods inherited from class org.entityfs.util.zip.AbstractZipCreator |
---|
create, create, 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 JarCreator(Iterator<? extends ZipEntryInfo> itr, DirectoryView targetDir, String targetFileName)
JarCreator
that uses the default
ErrorHandlingStrategy
.
itr
- The iterator to get ZipEntryInfo
objects from.targetDir
- The directory where the Jar file will be created.targetFileName
- The name of the Jar file.public JarCreator(Iterator<? extends ZipEntryInfo> itr, DirectoryView targetDir, String targetFileName, ErrorHandlingStrategy ehs)
JarCreator
that uses the provided
ErrorHandlingStrategy
.
itr
- The iterator to get ZipEntryInfo
objects from.targetDir
- The directory where the Jar file will be created.targetFileName
- The name of the Jar file.ehs
- The error handling strategy.Method Detail |
---|
public JarCreator setManifest(Manifest mf)
mf
- The manifest.
this
.public Manifest getManifest()
protected ZipOutputStream createOutputStream(WritableFile f) throws IOException
JarOutputStream
instead.
createOutputStream
in class AbstractZipCreator<JarCreator>
JarOutputStream
.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |