import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.HttpURLConnection;
-import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
}
/**
- * Open a resource (will load it from the cache if possible, or save it into
- * the cache after downloading if not) as an Image, then save it where
- * requested.
- * <p>
- * This version will not always work properly if the original file was not
- * downloaded before.
+ * Save the given resource as an image on disk using the default image
+ * format for content.
*
* @param url
- * the resource to open
- *
- * @return the opened resource image
+ * the resource
+ * @param target
+ * the target file
*
* @throws IOException
* in case of I/O error
*
* @param uniqueID
* the unique ID
- *
+ *
* @return the content or NULL
*/
public InputStream getFromCache(String uniqueID) {
*
* @throws IOException
* in case of I/O error
- * @throws URISyntaxException
*/
private void save(URL url, BasicSupport support, URL originalUrl)
throws IOException {
*
* @param url
* the url
+ *
* @return the cached version if present, NULL if not
*/
private File getCached(URL url) {
* Get the cache resource from the cache if it is present for this unique
* ID.
*
- * @param url
- * the url
+ * @param uniqueID
+ * the id
+ *
* @return the cached version if present, NULL if not
*/
private File getCached(String uniqueID) {
* List the stories of the given type from the {@link Library} (unless NULL
* is passed, in which case all stories will be listed).
*
- * @param typeString
+ * @param type
* the type to list the known stories of, or NULL to list all
* stories
*
import be.nikiroo.utils.Version;
+/**
+ * Version checker: can check the current version of the program against a
+ * remote changelog, and list the missed updates and their description.
+ *
+ * @author niki
+ */
public class VersionCheck {
private static final String url = "https://github.com/nikiroo/fanfix/raw/master/changelog.md";
* @author niki
*/
public class ConfigBundle extends Bundle<Config> {
+ /**
+ * Create a new {@link ConfigBundle}.
+ */
public ConfigBundle() {
super(Config.class, Target.config);
}
/**
* This package encloses the different
- * {@link be.nikiroo.utils.resources.bundles.Bundle} and their associated
+ * {@link be.nikiroo.utils.resources.Bundle} and their associated
* {@link java.lang.Enum}s used by the application.
*
* @author niki
/**
* The included paragraphs.
*
- * @param paragraphes
+ * @param paragraphs
* the paragraphs to set
*/
public void setParagraphs(List<Paragraph> paragraphs) {
/**
* A unique value representing the story in the local library.
*
- * @param uuid
+ * @param luid
* the luid to set
*/
public void setLuid(String luid) {
/**
* Create a new {@link Paragraph} with the given image.
*
- * @param support
- * the support that will be used to fetch the image via
- * {@link Paragraph#getContentImage()}.
- * @param content
- * the content image of this paragraph
+ * @param imageUrl
+ * the image as an URL
*/
public Paragraph(URL imageUrl) {
this(ParagraphType.IMAGE, imageUrl.toString(), 0);
}
/**
- * Call {@link OutputType#valueOf(String.toUpperCase())}.
+ * Call {@link OutputType#valueOf(String)} after conversion to upper
+ * case.
*
* @param typeName
* the possible type name
}
/**
- * Call {@link OutputType#valueOf(String.toUpperCase())} but return NULL
- * for NULL and empty instead of raising an exception.
+ * Call {@link OutputType#valueOf(String)} after conversion to upper
+ * case but return NULL for NULL and empty instead of raising an
+ * exception.
*
* @param typeName
* the possible type name
}
/**
- * Call {@link OutputType#valueOf(String.toUpperCase())} but return NULL
- * in case of error instead of raising an exception.
+ * Call {@link OutputType#valueOf(String)} after conversion to upper
+ * case but return NULL in case of error instead of raising an
+ * exception.
*
* @param typeName
* the possible type name
*
* @param type
* the new type
- * @param infoCover
- * TRUE to enable the creation of a .info file and a cover if
- * possible
+ * @param writeInfo
+ * TRUE to enable the creation of a .info file
+ * @param writeCover
+ * TRUE to enable the creation of a cover if possible
*
* @return this
*/
}
/**
- * Call {@link SupportType#valueOf(String.toUpperCase())}.
+ * Call {@link SupportType#valueOf(String)} after conversion to upper
+ * case.
*
* @param typeName
* the possible type name
}
/**
- * Call {@link SupportType#valueOf(String.toUpperCase())} but return
- * NULL for NULL instead of raising exception.
+ * Call {@link SupportType#valueOf(String)} after conversion to upper
+ * case but return NULL for NULL instead of raising exception.
*
* @param typeName
* the possible type name
}
/**
- * Call {@link SupportType#valueOf(String.toUpperCase())} but return
- * NULL in case of error instead of raising an exception.
+ * Call {@link SupportType#valueOf(String)} after conversion to upper
+ * case but return NULL in case of error instead of raising an
+ * exception.
*
* @param typeName
* the possible type name
*/
protected abstract boolean isHtml();
+ /**
+ * Return the {@link MetaData} of this story.
+ *
+ * @param source
+ * the source of the story
+ * @param in
+ * the input (the main resource)
+ *
+ * @return the associated {@link MetaData}
+ *
+ * @throws IOException
+ * in case of I/O error
+ */
protected abstract MetaData getMeta(URL source, InputStream in)
throws IOException;
*
* @param url
* the story resource
- *
* @param close
* close "this" and "in" when done
+ * @param getDesc
+ * retrieve the description of the story, or not
* @param pg
* the optional progress reporter
*
* Create a {@link Chapter} object from the given information, formatting
* the content as it should be.
*
+ * @param source
+ * the source of the story
* @param number
* the chapter number
* @param name
* @return the {@link URL}
*
* @throws MalformedURLException
+ * in case of data error
*/
private URL guest(String link) throws MalformedURLException {
if (link.contains("?")) {