if (type != null) {
story = BasicSupport.getSupport(type).process(url,
pgProcess);
+ // Because we do not want to clear the meta cache:
+ meta.setCover(story.getMeta().getCover());
story.setMeta(meta);
+ //
} else {
throw new IOException("Unknown type: " + meta.getType());
}
} catch (IOException e) {
// We should not have not-supported files in the
// library
- Instance.getTraceHandler().error(new IOException(
- "Cannot load file from library: " + file, e));
+ Instance.getTraceHandler().error(
+ new IOException("Cannot load file from library: "
+ + file, e));
} finally {
pgProcess.done();
pg.done();
return type;
}
+ /**
+ * Enable the creation of a .info file next to the resulting processed file.
+ *
+ * @return TRUE to enable it
+ */
+ protected boolean isWriteInfo() {
+ return writeInfo;
+ }
+
+ /**
+ * Enable the creation of a cover file next to the resulting processed file
+ * if possible.
+ *
+ * @return TRUE to enable it
+ */
+ protected boolean isWriteCover() {
+ return writeCover;
+ }
+
/**
* The output type.
*
dir.mkdir();
try {
// will also save the images!
- new InfoText().process(story, dir, targetNameOrig);
+ BasicOutput.getOutput(OutputType.TEXT, isWriteInfo()).process(
+ story, dir, targetNameOrig);
InfoCover.writeInfo(dir, targetNameOrig, story.getMeta());
if (story.getMeta() != null && !story.getMeta().isFakeCover()) {
// "Originals"
File data = new File(tmpDir, "DATA");
data.mkdir();
- new InfoText().process(story, data, targetNameOrig);
+ BasicOutput.getOutput(OutputType.TEXT, isWriteInfo()).process(story,
+ data, targetNameOrig);
InfoCover.writeInfo(data, targetNameOrig, story.getMeta());
IOUtils.writeSmallFile(data, "version", "3.0");
// write a copy of the originals inside
InfoCover.writeInfo(dir, targetName, story.getMeta());
InfoCover.writeCover(dir, targetName, story.getMeta());
- new InfoText().process(story, dir, targetNameOrig);
+ BasicOutput.getOutput(OutputType.TEXT, isWriteInfo()).process(story,
+ dir, targetNameOrig);
target = new File(targetDir, targetName + getDefaultExtension(true));