@Override
public synchronized Image getCustomAuthorCover(String author) {
+ if (authorCovers == null) {
+ authorCovers = new HashMap<String, Image>();
+ }
+
+ Image img = authorCovers.get(author);
+ if (img != null) {
+ return img;
+ }
+
File cover = getAuthorCoverFile(author);
if (cover.exists()) {
InputStream in;
return text;
}
+ /**
+ * Return the default {@link OutputType} for this kind of {@link Story}.
+ *
+ * @param imageDocument
+ * TRUE for images document, FALSE for text documents
+ *
+ * @return the type
+ */
+ public String getOutputType(boolean imageDocument) {
+ if (imageDocument) {
+ return image.toString();
+ }
+
+ return text.toString();
+ }
+
/**
* Get the target {@link File} related to the given <tt>.info</tt>
* {@link File} and {@link MetaData}.
boolean info = file != null && file.isFile()
&& file.getPath().toLowerCase().endsWith(".info");
boolean dir = file != null && file.isDirectory();
- return info || dir;
+ boolean isExpandedHtml = new File(file, "index.html").isFile();
+ return info || (dir && !isExpandedHtml);
}
});