Mercurial > hg > digilib-old
view servlet/src/digilib/pdf/PDFFileWorker.java @ 741:ee620bcf4ab0 jquery
image-drag now with full background image :-)
if your browser supports background-size.
and some cleanups.
author | robcast |
---|---|
date | Wed, 02 Feb 2011 20:03:36 +0100 |
parents | fd2ef7e46119 |
children | 72662bb585ba |
line wrap: on
line source
/** * */ package digilib.pdf; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.concurrent.Callable; import digilib.image.DocuImage; import digilib.servlet.DigilibConfiguration; import digilib.servlet.PDFRequest; import digilib.util.DigilibJobCenter; /** * @author casties * */ public class PDFFileWorker implements Callable<File> { /** the wrapped PDFStreamWorker */ protected PDFStreamWorker streamWorker; /** the temporary output file */ protected File tempFile; /** the final output file */ protected File finalFile; /** Create new PDFFileWorker. * @param dlConfig * @param tempFile * @param job_info * @param imageJobCenter * @throws FileNotFoundException */ public PDFFileWorker(DigilibConfiguration dlConfig, File tempFile, File finalFile, PDFRequest job_info, DigilibJobCenter<DocuImage> imageJobCenter) throws FileNotFoundException { this.tempFile = tempFile; OutputStream outstream = new FileOutputStream(tempFile); this.finalFile = finalFile; this.streamWorker = new PDFStreamWorker(dlConfig, outstream, job_info, imageJobCenter); } public File call() throws Exception { OutputStream outstream = streamWorker.call(); outstream.flush(); // move temporary to final file tempFile.renameTo(finalFile); return finalFile; } }