- File infoFile = new File(path + ".info");
- if (!infoFile.exists()) {
- infoFile = new File(path.substring(0, path.length()
- - fileExt.length())
- + ".info");
- }
- infoFile.delete();
-
- String coverExt = "."
- + Instance.getConfig().getString(
- Config.IMAGE_FORMAT_COVER);
- File coverFile = new File(path + coverExt);
- if (!coverFile.exists()) {
- coverFile = new File(path.substring(0, path.length()
- - fileExt.length()));
+ // clear cache
+ stories.clear();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * The library is accessed locally or at local speed (for operations like
+ * {@link Library#getFile(String)}).
+ * <p>
+ * It could be cached, too, it is only about the access speed.
+ *
+ * @return TRUE if it is accessed locally
+ */
+ public boolean isLocalSpeed() {
+ return localSpeed;
+ }
+
+ /**
+ * Return the list of files/dirs on disk for this {@link Story}.
+ * <p>
+ * If the {@link Story} is not found, and empty list is returned.
+ *
+ * @param luid
+ * the {@link Story} LUID
+ *
+ * @return the list of {@link File}s
+ */
+ private List<File> getFiles(String luid) {
+ List<File> files = new ArrayList<File>();
+
+ MetaData meta = getInfo(luid);
+ File file = getFile(luid); // to help remote implementation
+
+ if (file != null) {
+ files.add(file);
+
+ String readerExt = getOutputType(meta).getDefaultExtension(true);
+ String fileExt = getOutputType(meta).getDefaultExtension(false);
+
+ String path = file.getAbsolutePath();
+ if (readerExt != null && !readerExt.equals(fileExt)) {
+ path = path.substring(0, path.length() - readerExt.length())
+ + fileExt;
+ file = new File(path);
+
+ if (file.exists()) {
+ files.add(file);