X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FHtml.java;h=900fa0a1772f0ffd5ecfcaf2fecfbd8b248168a0;hb=a5d1f0e6320710cc4c8163adf2dc402e8f05fb96;hp=fffbcd7f0ad6507ccb026f7fd49fcc83aa987b1a;hpb=a4143cd74a90e17a811a4581cbeb213fed1f6304;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Html.java b/src/be/nikiroo/fanfix/supported/Html.java deleted file mode 100644 index fffbcd7..0000000 --- a/src/be/nikiroo/fanfix/supported/Html.java +++ /dev/null @@ -1,53 +0,0 @@ -package be.nikiroo.fanfix.supported; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -/** - * Support class for HTML files created with this program (as we need some - * metadata available in those we create). - * - * @author niki - */ -class Html extends InfoText { - @Override - public String getSourceName() { - return "html"; - } - - @Override - protected boolean supports(URL url) { - if (url.getPath().toLowerCase() - .endsWith(File.separatorChar + "index.html")) { - try { - File file = new File(url.toURI()).getParentFile(); - return super.supports(file.toURI().toURL()); - } catch (URISyntaxException e) { - } catch (MalformedURLException e) { - } - } - - return false; - } - - @Override - public URL getCanonicalUrl(URL source) throws IOException { - if (source.toString().endsWith(File.separator + "index.html")) { - try { - File fakeFile = new File(source.toURI()); // "story/index.html" - fakeFile = new File(fakeFile.getParent()); // "story" - fakeFile = new File(fakeFile, fakeFile.getName()); // "story/story" - return fakeFile.toURI().toURL(); - } catch (URISyntaxException e) { - throw new IOException( - "file not supported (maybe not created with this program or corrupt)", - e); - } - } - - return source; - } -}