X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Fsupport%2FBasicSupport.java;h=7a1d0eab9da69291bc112dcbd7f67abb127a49c6;hb=588b54b87668da980ca64c032831c78106b233be;hp=1105df54097ced61acdfabf0d3eb2cf5022440c5;hpb=737852686d8897331706ed4b902dbd9d5038cb53;p=gofetch.git diff --git a/src/be/nikiroo/gofetch/support/BasicSupport.java b/src/be/nikiroo/gofetch/support/BasicSupport.java index 1105df5..7a1d0ea 100644 --- a/src/be/nikiroo/gofetch/support/BasicSupport.java +++ b/src/be/nikiroo/gofetch/support/BasicSupport.java @@ -7,12 +7,11 @@ import java.net.URLConnection; import java.util.List; import java.util.zip.GZIPInputStream; -import be.nikiroo.gofetch.data.Comment; import be.nikiroo.gofetch.data.Story; public abstract class BasicSupport { public enum Type { - SLASHDOT, + SLASHDOT, PIPEDOT, LWN, } static private String preselector; @@ -21,10 +20,20 @@ public abstract class BasicSupport { abstract public List list() throws IOException; - abstract public List getComments(Story story) throws IOException; + /** + * Fetch the full article content as well as all the comments associated to + * this {@link Story}, if any (can be empty, but not NULL). + * + * @param story + * the story to fetch the comments of + * + * @throws IOException + * in case of I/O error + */ + abstract public void fetch(Story story) throws IOException; abstract public String getDescription(); - + public String getSelector() { return getSelector(type); } @@ -53,6 +62,12 @@ public abstract class BasicSupport { case SLASHDOT: support = new Slashdot(); break; + case PIPEDOT: + support = new Pipedot(); + break; + case LWN: + support = new LWN(); + break; } if (support != null) {