Code cleanup: Libraries/Readers
[fanfix.git] / src / be / nikiroo / fanfix / reader / CliReader.java
index f9e4b700f804780861780a695dfbc98a56f36a60..de55bf9b06a8a033662037c14cb412f1615844e1 100644 (file)
@@ -18,7 +18,6 @@ import be.nikiroo.fanfix.data.Story;
  * @author niki
  */
 class CliReader extends BasicReader {
-       @Override
        public void read() throws IOException {
                if (getStory() == null) {
                        throw new IOException("No story to read");
@@ -57,8 +56,11 @@ class CliReader extends BasicReader {
                }
        }
 
-       @Override
-       public void read(int chapter) {
+       public void read(int chapter) throws IOException {
+               if (getStory() == null) {
+                       throw new IOException("No story to read");
+               }
+
                if (chapter > getStory().getChapters().size()) {
                        System.err.println("Chapter " + chapter + ": no such chapter");
                } else {
@@ -73,10 +75,9 @@ class CliReader extends BasicReader {
                }
        }
 
-       @Override
-       public void start(String type) {
+       public void browse(String source) {
                List<MetaData> stories;
-               stories = Instance.getLibrary().getList(type);
+               stories = getLibrary().getListBySource(source);
 
                for (MetaData story : stories) {
                        String author = "";