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 b3dd3edc79300b28c2ea779c91c887bbbbd9d704..de55bf9b06a8a033662037c14cb412f1615844e1 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/CliReader.java
+++ b/
src/be/nikiroo/fanfix/reader/CliReader.java
@@
-9,7
+9,6
@@
import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
/**
* Command line {@link Story} reader.
/**
* Command line {@link Story} reader.
@@
-19,7
+18,6
@@
import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
* @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");
@@
-58,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 {
@@
-74,10
+75,9
@@
class CliReader extends BasicReader {
}
}
}
}
- @Override
- public void start(SupportType 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 = "";