*/
public LocalLibrary(File baseDir) {
this(baseDir, Instance.getConfig().getString(
- Config.NON_IMAGES_DOCUMENT_TYPE), Instance.getConfig()
- .getString(Config.IMAGES_DOCUMENT_TYPE), false);
+ Config.FILE_FORMAT_NON_IMAGES_DOCUMENT_TYPE), Instance.getConfig()
+ .getString(Config.FILE_FORMAT_IMAGES_DOCUMENT_TYPE), false);
}
/**
}
@Override
- public File getFile(String luid, Progress pg) {
+ public File getFile(String luid, Progress pg) throws IOException {
Instance.getTraceHandler().trace(
this.getClass().getSimpleName() + ": get file for " + luid);
}
@Override
- public Image getCover(String luid) {
+ public Image getCover(String luid) throws IOException {
MetaData meta = getInfo(luid);
if (meta != null) {
if (meta.getCover() != null) {
}
@Override
- public void setSourceCover(String source, String luid) {
+ public void setSourceCover(String source, String luid) throws IOException {
setSourceCover(source, getCover(luid));
}
@Override
- public void setAuthorCover(String author, String luid) {
+ public void setAuthorCover(String author, String luid) throws IOException {
setAuthorCover(author, getCover(luid));
}
if (meta != null && meta.isImageDocument()) {
return image;
}
-
+
return text;
}
-
+
/**
* Return the default {@link OutputType} for this kind of {@link Story}.
*
* @param imageDocument
- * TRUE for images document, FALSE for text documents
+ * TRUE for images document, FALSE for text documents
*
* @return the type
*/
private File getAuthorCoverFile(String author) {
File aDir = new File(baseDir, "_AUTHORS");
String hash = StringUtils.getMd5Hash(author);
- String ext = Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER);
+ String ext = Instance.getConfig().getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER);
return new File(aDir, hash + "." + ext.toLowerCase());
}
}
String coverExt = "."
- + Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER)
+ + Instance.getConfig().getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER)
.toLowerCase();
File coverFile = new File(path + coverExt);
if (!coverFile.exists()) {