separate support name and BasicSupport
[fanfix.git] / src / be / nikiroo / fanfix / supported / Html.java
index c7db5d83ce3c0f16d1525dbb591f9453571cd420..c27dd32f181651186446bbe597c09b6f6b7d8c5b 100644 (file)
@@ -14,11 +14,6 @@ import be.nikiroo.fanfix.Instance;
  * @author niki
  */
 class Html extends InfoText {
-       @Override
-       public String getSourceName() {
-               return "html";
-       }
-
        @Override
        protected boolean supports(URL url) {
                try {
@@ -32,6 +27,23 @@ class Html extends InfoText {
                return false;
        }
 
+       @Override
+       protected File getInfoFile() {
+               File source = getSourceFile();
+               if ("index.html".equals(source.getName())) {
+                       source = source.getParentFile();
+               }
+
+               String src = source.getPath();
+               File infoFile = new File(src + ".info");
+               if (!infoFile.exists() && src.endsWith(".txt")) {
+                       infoFile = new File(
+                                       src.substring(0, src.length() - ".txt".length()) + ".info");
+               }
+
+               return infoFile;
+       }
+
        @Override
        public URL getCanonicalUrl(URL source) {
                File txt = getTxt(source);