Search in sources :

Example 1 with NoHosterFoundException

use of de.herrlock.manga.host.exceptions.NoHosterFoundException in project Manga by herrlock.

the class ChapterList method getInstance.

/**
 * creates an instance of {@linkplain ChapterList}, gets the right {@linkplain Details} from the {@linkplain URL} in the given
 * {@link DownloadConfiguration}
 *
 * @param conf
 *            the {@link DownloadConfiguration} to use
 * @return an instance of {@link ChapterList}; when no suitable Hoster can be detected {@code null}
 */
public static ChapterList getInstance(final DownloadConfiguration conf) {
    logger.traceEntry("Configuration: {}", conf);
    URL url = conf.getUrl();
    Hoster h;
    try {
        h = Hosters.getHostByURL(url);
    } catch (NoHosterFoundException ex) {
        throw new InitializeException(ex);
    }
    logger.debug("Selected Hoster: {}", h.getName());
    return h.getChapterList(conf);
}
Also used : InitializeException(de.herrlock.manga.exceptions.InitializeException) NoHosterFoundException(de.herrlock.manga.host.exceptions.NoHosterFoundException) URL(java.net.URL)

Aggregations

InitializeException (de.herrlock.manga.exceptions.InitializeException)1 NoHosterFoundException (de.herrlock.manga.host.exceptions.NoHosterFoundException)1 URL (java.net.URL)1