git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code cleanup: Libraries/Readers
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
reader
/
CliReader.java
diff --git
a/src/be/nikiroo/fanfix/reader/CliReader.java
b/src/be/nikiroo/fanfix/reader/CliReader.java
index f9e4b700f804780861780a695dfbc98a56f36a60..de55bf9b06a8a033662037c14cb412f1615844e1 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/CliReader.java
+++ b/
src/be/nikiroo/fanfix/reader/CliReader.java
@@
-18,7
+18,6
@@
import be.nikiroo.fanfix.data.Story;
* @author niki
*/
class CliReader extends BasicReader {
* @author niki
*/
class CliReader extends BasicReader {
- @Override
public void read() throws IOException {
if (getStory() == null) {
throw new IOException("No story to read");
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 {
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;
List<MetaData> stories;
- stories =
Instance.getLibrary().getList(typ
e);
+ stories =
getLibrary().getListBySource(sourc
e);
for (MetaData story : stories) {
String author = "";
for (MetaData story : stories) {
String author = "";