X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FHtml.java;h=900fa0a1772f0ffd5ecfcaf2fecfbd8b248168a0;hb=HEAD;hp=c7db5d83ce3c0f16d1525dbb591f9453571cd420;hpb=0ec7855764b78c0956c552566fe52587c2b43f4e;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Html.java b/src/be/nikiroo/fanfix/supported/Html.java index c7db5d8..900fa0a 100644 --- a/src/be/nikiroo/fanfix/supported/Html.java +++ b/src/be/nikiroo/fanfix/supported/Html.java @@ -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); @@ -39,9 +51,8 @@ class Html extends InfoText { try { source = txt.toURI().toURL(); } catch (MalformedURLException e) { - Instance.getTraceHandler().error( - new IOException("Cannot convert the right URL for " - + source, e)); + Instance.getInstance().getTraceHandler() + .error(new IOException("Cannot convert the right URL for " + source, e)); } }