X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FBasicReader.java;h=eabbe7e4408ddf758c623fd65c835e1a3643a95a;hp=3403f872a2fbbfc12fe17f646b6792d768fb4513;hb=333f0e7b5e333e8f6222881ce35398f403fc4121;hpb=a6395bef99a8e917f67341ef1906917b87df24a4 diff --git a/src/be/nikiroo/fanfix/reader/BasicReader.java b/src/be/nikiroo/fanfix/reader/BasicReader.java index 3403f87..eabbe7e 100644 --- a/src/be/nikiroo/fanfix/reader/BasicReader.java +++ b/src/be/nikiroo/fanfix/reader/BasicReader.java @@ -8,7 +8,6 @@ import be.nikiroo.fanfix.Library; import be.nikiroo.fanfix.bundles.Config; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.supported.BasicSupport; -import be.nikiroo.fanfix.supported.BasicSupport.SupportType; /** * The class that handles the different {@link Story} readers you can use. @@ -147,7 +146,7 @@ public abstract class BasicReader { * the type of {@link Story} to take into account, or NULL for * all */ - public abstract void start(SupportType type); + public abstract void start(String type); /** * Return a new {@link BasicReader} ready for use if one is configured. @@ -157,13 +156,18 @@ public abstract class BasicReader { * @return a {@link BasicReader}, or NULL if none configured */ public static BasicReader getReader() { - if (defaultType != null) { - switch (defaultType) { - // case LOCAL: - // return new LocalReader().setType(ReaderType.LOCAL); - case CLI: - return new CliReader().setType(ReaderType.CLI); + try { + if (defaultType != null) { + switch (defaultType) { + case LOCAL: + return new LocalReader().setType(ReaderType.LOCAL); + case CLI: + return new CliReader().setType(ReaderType.CLI); + } } + } catch (IOException e) { + Instance.syserr(new Exception("Cannot create a reader of type: " + + defaultType, e)); } return null;