net.sf.jomic.comic
Class CreateCbzComicTask

java.lang.Object
  extended by net.sf.jomic.tools.AbstractTask
      extended by net.sf.jomic.comic.AbstractCreateComicTask
          extended by net.sf.jomic.comic.CreateCbzComicTask
All Implemented Interfaces:
Task

public class CreateCbzComicTask
extends AbstractCreateComicTask

Task to create a CBZ comic from a set of image files.

Author:
Thomas Aglassinger

Constructor Summary
CreateCbzComicTask(java.io.File newSourceBaseDir, java.lang.String[] newSourceFileNames, java.util.Map newComicInfoMap, java.io.File newTargetZipFile, Conversion newConversion)
          Create a new task to create a CBZ comic.
 
Method Summary
protected  void addImageFile(java.lang.String outImageName, java.io.File sourceImageFile)
          Add an image file to the target comic stream/document/file/whatever.
protected  void cleanUpComic()
          Release all resources need allocated by setUpComic() to create the target comic stream/document/file/whatever.
protected  void setUpComic()
          Allocate all resources needed to create the target comic file.
 
Methods inherited from class net.sf.jomic.comic.AbstractCreateComicTask
enableAddedAtLeastOneImage, getConversion, getImageInfo, getSourceBaseDir, getTargetComicFile, hasAddedAtLeastOneImage, start
 
Methods inherited from class net.sf.jomic.tools.AbstractTask
addProgressChangeListener, getMaxProgress, getProgress, getProgressMessage, isInterrupted, removeProgressChangeListener, setMaxProgress, setProgress, setProgressMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateCbzComicTask

public CreateCbzComicTask(java.io.File newSourceBaseDir,
                          java.lang.String[] newSourceFileNames,
                          java.util.Map newComicInfoMap,
                          java.io.File newTargetZipFile,
                          Conversion newConversion)
Create a new task to create a CBZ comic.

Parameters:
newSourceBaseDir - the base directory where the source files are located
newSourceFileNames - the names of the files relative to newSourceBaseDir that should be included in the archive
newComicInfoMap - Description of the parameter
newTargetZipFile - the ZIP file to create
newConversion - a conversion specifying the format and image manipulations of the new comic; if null, the default will be a conversion creating a CBZ including all the images specified.
Method Detail

setUpComic

protected void setUpComic()
                   throws java.lang.Exception
Description copied from class: AbstractCreateComicTask
Allocate all resources needed to create the target comic file. They will be released when done by calling cleanUpComic() either when done or an error occurs.

Specified by:
setUpComic in class AbstractCreateComicTask
Throws:
java.lang.Exception
See Also:
AbstractCreateComicTask.cleanUpComic()

addImageFile

protected void addImageFile(java.lang.String outImageName,
                            java.io.File sourceImageFile)
                     throws java.lang.Exception
Description copied from class: AbstractCreateComicTask
Add an image file to the target comic stream/document/file/whatever.

Specified by:
addImageFile in class AbstractCreateComicTask
Parameters:
outImageName - the name under which the image should be stored (if applicable for the output format)
sourceImageFile - the source image file to be added
Throws:
java.lang.Exception

cleanUpComic

protected void cleanUpComic()
                     throws java.lang.Exception
Description copied from class: AbstractCreateComicTask
Release all resources need allocated by setUpComic() to create the target comic stream/document/file/whatever. This will be called in any case even if something went wrong during setUpComic() so this routine must be able to handle null values without resulting in NullPointerExceptions.

Specified by:
cleanUpComic in class AbstractCreateComicTask
Throws:
java.lang.Exception
See Also:
AbstractCreateComicTask.setUpComic()