+ boolean infoPresent = false;
+ File file;
+ try {
+ file = new File(url.toURI());
+ file = assureNoTxt(file);
+ file = new File(file.getPath() + ".info");
+ } catch (URISyntaxException e) {
+ Instance.getInstance().getTraceHandler().error(e);
+ file = null;
+ }
+
+ infoPresent = (file != null && file.exists());
+
+ return infoPresent == info;
+ }
+
+ /**
+ * Remove the ".txt" (or ".text") extension if it is present.
+ *
+ * @param file
+ * the file to process
+ *
+ * @return the same file or a copy of it without the ".txt" extension if it
+ * was present
+ */
+ protected File assureNoTxt(File file) {
+ for (String ext : new String[] { ".txt", ".text" }) {
+ if (file.getName().endsWith(ext)) {
+ file = new File(file.getPath().substring(0,
+ file.getPath().length() - ext.length()));
+ }
+ }
+
+ return file;