X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsearchable%2FBasicSearchable.java;h=c6394430e6e08c8b34ff49e2a0d2b819f6da47bc;hb=e66c9078be4348bf9c799470973220d9ab2053cd;hp=25c388a8e268aa1bde8a26f84c4d10a2721be070;hpb=fd69647f9b69d8862c1be0910e877b8cbbb98272;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java index 25c388a..c639443 100644 --- a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java +++ b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java @@ -115,26 +115,34 @@ public abstract class BasicSearchable { * * @param tagId * the tag to search for + * @param page + * the page to use for result pagination (see + * {@link SearchableTag#getPages()}, remember to check for -1), + * index is 1-based * * @return a list of stories that satisfy that search term * * @throws IOException * in case of I/O error */ - abstract public List search(SearchableTag tag) throws IOException; + abstract public List search(SearchableTag tag, int page) + throws IOException; /** * Load a document from its url. * * @param url * the URL to load + * @param stable + * TRUE for more stable resources, FALSE when they often change + * * @return the document * * @throws IOException * in case of I/O error */ - protected Document load(String url) throws IOException { - return load(new URL(url)); + protected Document load(String url, boolean stable) throws IOException { + return load(new URL(url), stable); } /** @@ -142,13 +150,16 @@ public abstract class BasicSearchable { * * @param url * the URL to load + * @param stable + * TRUE for more stable resources, FALSE when they often change + * * @return the document * * @throws IOException * in case of I/O error */ - protected Document load(URL url) throws IOException { - return DataUtil.load(Instance.getCache().open(url, support, false), + protected Document load(URL url, boolean stable) throws IOException { + return DataUtil.load(Instance.getCache().open(url, support, stable), "UTF-8", url.toString()); }