*
* @param url
* the resource to open
+ * @param allowTooOld
+ * allow files even if they are considered too old
+ * @param stable
+ * a stable file (that dones't change too often) -- parameter
+ * used to check if the file is too old to keep or not
*
* @return the opened resource if found, NULL i not
*
* @throws IOException
* in case of I/O error
*/
- private InputStream load(URL url, boolean allowOld, boolean stable)
+ private InputStream load(URL url, boolean allowTooOld, boolean stable)
throws IOException {
File cached = getCached(url);
- if (cached.exists() && !isOld(cached, stable)) {
+ if (cached.exists() && (allowTooOld || !isOld(cached, stable))) {
return new MarkableFileInputStream(new FileInputStream(cached));
}
mainProgress.addProgressListener(new Progress.ProgressListener() {
private int current = mainProgress.getMin();
+ @Override
public void progress(Progress progress, String name) {
int diff = progress.getProgress() - current;
current += diff;
writer.write("# Also, the comments always refer to the key below them.\n");
writer.write("# \n");
}
-};
+}
/**
* Empty constructor, not to use.
*/
+ @SuppressWarnings("unused")
private Chapter() {
// for serialisation purposes
}
/**
* Get an iterator on the {@link Paragraph}s.
*/
+ @Override
public Iterator<Paragraph> iterator() {
return paragraphs == null ? empty.iterator() : paragraphs.iterator();
}
this.fakeCover = fakeCover;
}
+ @Override
public int compareTo(MetaData o) {
String oUuid = o == null ? null : o.getUuid();
return getUuid().compareTo(oUuid);
/**
* Empty constructor, not to use.
*/
+ @SuppressWarnings("unused")
private Paragraph() {
// for serialisation purposes
}
/**
* Get an iterator on the {@link Chapter}s.
*/
+ @Override
public Iterator<Chapter> iterator() {
return chapters == null ? empty.iterator() : chapters.iterator();
}
private OutputType getOutputType(MetaData meta) {
if (meta != null && meta.isImageDocument()) {
return image;
- } else {
- return text;
}
+
+ return text;
}
/**
MetaData meta = getInfo(luid);
if (meta == null) {
throw new IOException("Story not found: " + luid);
- } else {
- File infoFile = getStories(null).get(meta)[0];
- File targetFile = getStories(null).get(meta)[1];
+ }
- files.add(infoFile);
- files.add(targetFile);
+ File infoFile = getStories(null).get(meta)[0];
+ File targetFile = getStories(null).get(meta)[1];
- String readerExt = getOutputType(meta).getDefaultExtension(true);
- String fileExt = getOutputType(meta).getDefaultExtension(false);
+ files.add(infoFile);
+ files.add(targetFile);
- String path = targetFile.getAbsolutePath();
- if (readerExt != null && !readerExt.equals(fileExt)) {
- path = path.substring(0, path.length() - readerExt.length())
- + fileExt;
- File relatedFile = new File(path);
+ String readerExt = getOutputType(meta).getDefaultExtension(true);
+ String fileExt = getOutputType(meta).getDefaultExtension(false);
- if (relatedFile.exists()) {
- files.add(relatedFile);
- }
- }
+ String path = targetFile.getAbsolutePath();
+ if (readerExt != null && !readerExt.equals(fileExt)) {
+ path = path.substring(0, path.length() - readerExt.length())
+ + fileExt;
+ File relatedFile = new File(path);
- String coverExt = "."
- + Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER);
- File coverFile = new File(path + coverExt);
- if (!coverFile.exists()) {
- coverFile = new File(path.substring(0,
- path.length() - fileExt.length())
- + coverExt);
+ if (relatedFile.exists()) {
+ files.add(relatedFile);
}
+ }
- if (coverFile.exists()) {
- files.add(coverFile);
- }
+ String coverExt = "."
+ + Instance.getConfig().getString(Config.IMAGE_FORMAT_COVER);
+ File coverFile = new File(path + coverExt);
+ if (!coverFile.exists()) {
+ coverFile = new File(path.substring(0,
+ path.length() - fileExt.length())
+ + coverExt);
+ }
+
+ if (coverFile.exists()) {
+ files.add(coverFile);
}
return files;
lastId = 0;
File[] dirs = baseDir.listFiles(new FileFilter() {
+ @Override
public boolean accept(File file) {
return file != null && file.isDirectory();
}
for (File dir : dirs) {
File[] infoFiles = dir.listFiles(new FileFilter() {
+ @Override
public boolean accept(File file) {
return file != null
&& file.getPath().toLowerCase()
try {
new ConnectActionClient(host, port, true, null) {
+ @Override
public void action(Version serverVersion) throws Exception {
try {
Object rep = send("GET_METADATA *");
final File[] tmp = new File[1];
try {
new ConnectActionClient(host, port, true, null) {
+ @Override
public void action(Version serverVersion) throws Exception {
try {
Object rep = send("GET_STORY " + luid);
;
+ @Override
public String toString() {
return super.toString().toLowerCase();
}
*
* @return the extension
*/
- public String getDefaultExtension(boolean readerTarget) {
+ public String getDefaultExtension(
+ @SuppressWarnings("unused") boolean readerTarget) {
return "";
}
+ @SuppressWarnings("unused")
protected void writeStoryHeader(Story story) throws IOException {
}
+ @SuppressWarnings("unused")
protected void writeChapterHeader(Chapter chap) throws IOException {
}
+ @SuppressWarnings("unused")
protected void writeParagraphHeader(Paragraph para) throws IOException {
}
+ @SuppressWarnings("unused")
protected void writeStoryFooter(Story story) throws IOException {
}
+ @SuppressWarnings("unused")
protected void writeChapterFooter(Chapter chap) throws IOException {
}
+ @SuppressWarnings("unused")
protected void writeParagraphFooter(Paragraph para) throws IOException {
}
writeParagraphFooter(para);
}
+ @SuppressWarnings("unused")
protected void writeTextLine(ParagraphType type, String line)
throws IOException {
}
public String getDefaultExtension(boolean readerTarget) {
if (readerTarget) {
return File.separator + "index.html";
- } else {
- return "";
}
+
+ return "";
}
@Override
}
}
+ @Override
public synchronized Story getStory(Progress pg) {
if (story == null) {
story = getLibrary().getStory(meta.getLuid(), pg);
return story;
}
+ @Override
public BasicLibrary getLibrary() {
if (lib == null) {
lib = defaultLibrary;
return lib;
}
+ @Override
public void setLibrary(BasicLibrary lib) {
this.lib = lib;
}
+ @Override
public MetaData getMeta() {
return meta;
}
+ @Override
public synchronized void setMeta(MetaData meta) throws IOException {
setMeta(meta == null ? null : meta.getLuid()); // must check the library
}
+ @Override
public synchronized void setMeta(String luid) throws IOException {
story = null;
meta = getLibrary().getInfo(luid);
}
}
+ @Override
public synchronized void setMeta(URL source, Progress pg)
throws IOException {
BasicSupport support = BasicSupport.getSupport(source);
meta = story.getMeta();
}
+ @Override
public int getChapter() {
return chapter;
}
+ @Override
public void setChapter(int chapter) {
this.chapter = chapter;
}
* @author niki
*/
class CliReader extends BasicReader {
+ @Override
public void read() throws IOException {
MetaData meta = getMeta();
}
}
+ @Override
public void browse(String source) {
List<MetaData> stories;
stories = getLibrary().getListBySource(source);
localLibrary = new LocalLibrary(dir, text, images);
}
+ @Override
public void read() throws IOException {
MetaData meta = getMeta();
return localLibrary.getInfo(luid) != null;
}
+ @Override
public void browse(String type) {
// TODO: improve presentation of update message
final VersionCheck updates = VersionCheck.check();
// handle link events
updateMessage.addHyperlinkListener(new HyperlinkListener() {
+ @Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType().equals(
HyperlinkEvent.EventType.ACTIVATED))
final String typeFinal = type;
EventQueue.invokeLater(new Runnable() {
+ @Override
public void run() {
if (updates.isNewVersionAvailable()) {
int rep = JOptionPane.showConfirmDialog(null,
private void setupListeners() {
listeners = new ArrayList<GuiReaderBook.BookActionListener>();
addMouseListener(new MouseListener() {
+ @Override
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
popup(e);
}
}
+ @Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
popup(e);
}
}
+ @Override
public void mouseExited(MouseEvent e) {
setHovered(false);
}
+ @Override
public void mouseEntered(MouseEvent e) {
setHovered(true);
}
+ @Override
public void mouseClicked(MouseEvent e) {
if (isEnabled()) {
Date now = new Date();
add(pgBar, BorderLayout.SOUTH);
pgBar.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
invalidate();
pgBar.setProgress(null);
});
pgBar.addUpdateListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
invalidate();
validate();
final Progress pg = new Progress();
final String typeF = type;
outOfUi(pg, new Runnable() {
+ @Override
public void run() {
GuiReaderFrame.this.reader.getLibrary().refresh(false, pg);
invalidate();
this.validate();
bookPane.setActionListener(new BookActionListener() {
+ @Override
public void select(GuiReaderBook book) {
selectedBook = book;
}
+ @Override
public void popupRequested(GuiReaderBook book, MouseEvent e) {
JPopupMenu popup = new JPopupMenu();
popup.add(createMenuItemOpenBook());
popup.show(e.getComponent(), e.getX(), e.getY());
}
+ @Override
public void action(final GuiReaderBook book) {
openBook(book);
}
JMenuItem imprt = new JMenuItem("Import URL...", KeyEvent.VK_U);
imprt.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
imprt(true);
}
});
JMenuItem imprtF = new JMenuItem("Import File...", KeyEvent.VK_F);
imprtF.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
imprt(false);
}
});
JMenuItem exit = new JMenuItem("Exit", KeyEvent.VK_X);
exit.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
GuiReaderFrame.this.dispatchEvent(new WindowEvent(
GuiReaderFrame.this, WindowEvent.WINDOW_CLOSING));
JMenuItem vauthors = new JMenuItem("Author");
vauthors.setMnemonic(KeyEvent.VK_A);
vauthors.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
words = false;
refreshBooks();
JMenuItem vwords = new JMenuItem("Word count");
vwords.setMnemonic(KeyEvent.VK_W);
vwords.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
words = true;
refreshBooks();
for (final String type : tt) {
JMenuItem item = new JMenuItem(type == null ? "All" : type);
item.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
removeBookPanes();
addBookPane(type, true);
JMenuItem item = new JMenuItem(author == null ? "All"
: author.isEmpty() ? "[unknown]" : author);
item.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
removeBookPanes();
addBookPane(author, false);
item.setMnemonic(KeyEvent.VK_F);
item.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
ConfigEditor<Config> ed = new ConfigEditor<Config>(
Config.class, Instance.getConfig(),
item.setMnemonic(KeyEvent.VK_U);
item.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
ConfigEditor<UiConfig> ed = new ConfigEditor<UiConfig>(
UiConfig.class, Instance.getUiConfig(),
JMenuItem export = new JMenuItem("Save as...", KeyEvent.VK_S);
export.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
fc.showDialog(GuiReaderFrame.this, "Save");
+ type.getDefaultExtension(false);
final Progress pg = new Progress();
outOfUi(pg, new Runnable() {
+ @Override
public void run() {
try {
reader.getLibrary().export(
private JMenuItem createMenuItemClearCache() {
JMenuItem refresh = new JMenuItem("Clear cache", KeyEvent.VK_C);
refresh.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
outOfUi(null, new Runnable() {
+ @Override
public void run() {
reader.clearLocalReaderCache(selectedBook.getMeta()
.getLuid());
selectedBook.setCached(false);
SwingUtilities.invokeLater(new Runnable() {
+ @Override
public void run() {
selectedBook.repaint();
}
final String ftype = type;
item.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
String type = ftype;
"Moving story",
JOptionPane.QUESTION_MESSAGE, null, null,
selectedBook.getMeta().getSource());
+
if (rep == null) {
return;
- } else {
- type = rep.toString();
}
+
+ type = rep.toString();
}
final String ftype = type;
outOfUi(null, new Runnable() {
+ @Override
public void run() {
reader.changeType(selectedBook.getMeta()
.getLuid(), ftype);
selectedBook = null;
SwingUtilities.invokeLater(new Runnable() {
+ @Override
public void run() {
setJMenuBar(createMenu());
}
private JMenuItem createMenuItemRedownload() {
JMenuItem refresh = new JMenuItem("Redownload", KeyEvent.VK_R);
refresh.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
final MetaData meta = selectedBook.getMeta();
imprt(meta.getUrl(), new Runnable() {
+ @Override
public void run() {
reader.delete(meta.getLuid());
GuiReaderFrame.this.selectedBook = null;
private JMenuItem createMenuItemDelete() {
JMenuItem delete = new JMenuItem("Delete", KeyEvent.VK_D);
delete.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
outOfUi(null, new Runnable() {
+ @Override
public void run() {
reader.delete(selectedBook.getMeta().getLuid());
selectedBook = null;
private JMenuItem createMenuItemOpenBook() {
JMenuItem open = new JMenuItem("Open", KeyEvent.VK_O);
open.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (selectedBook != null) {
openBook(selectedBook);
private void openBook(final GuiReaderBook book) {
final Progress pg = new Progress();
outOfUi(pg, new Runnable() {
+ @Override
public void run() {
try {
reader.read(book.getMeta().getLuid(), pg);
SwingUtilities.invokeLater(new Runnable() {
+ @Override
public void run() {
book.setCached(true);
}
setEnabled(false);
new Thread(new Runnable() {
+ @Override
public void run() {
run.run();
refreshBooks();
pg.addProgress(pgOnSuccess, 5);
outOfUi(pg, new Runnable() {
+ @Override
public void run() {
Exception ex = null;
try {
if (!ok) {
Instance.syserr(e);
SwingUtilities.invokeLater(new Runnable() {
+ @Override
public void run() {
JOptionPane.showMessageDialog(GuiReaderFrame.this,
"Cannot import: " + url, e.getMessage(),
books.add(book);
book.addActionListener(new BookActionListener() {
+ @Override
public void select(GuiReaderBook book) {
for (GuiReaderBook abook : books) {
abook.setSelected(abook == book);
}
}
+ @Override
public void popupRequested(GuiReaderBook book, MouseEvent e) {
}
+ @Override
public void action(GuiReaderBook book) {
}
});
return null;
}
- };
+ }
/**
* Return the current target {@link MetaData}.
return backendType;
}
+ @Override
public void read() throws IOException {
try {
TuiReaderApplication app = new TuiReaderApplication(this,
}
}
+ @Override
public void browse(String source) {
List<MetaData> metas = getLibrary().getListBySource(source);
try {
new TuiReaderMainWindow(this).setMetas(stories);
}
+ @SuppressWarnings("unused")
+ @Override
public void read() throws IOException {
MetaData meta = getMeta();
}
}
+ @Override
public MetaData getMeta() {
return reader.getMeta();
}
+ @Override
public Story getStory(Progress pg) {
return reader.getStory(pg);
}
+ @Override
public BasicLibrary getLibrary() {
return reader.getLibrary();
}
+ @Override
public void setLibrary(BasicLibrary lib) {
reader.setLibrary(lib);
}
+ @Override
public void setMeta(MetaData meta) throws IOException {
reader.setMeta(meta);
}
+ @Override
public void setMeta(String luid) throws IOException {
reader.setMeta(luid);
}
+ @Override
public void setMeta(URL source, Progress pg) throws IOException {
reader.setMeta(source, pg);
}
+ @Override
public void browse(String source) {
reader.browse(source);
}
+ @Override
public int getChapter() {
return reader.getChapter();
}
+ @Override
public void setChapter(int chapter) {
reader.setChapter(chapter);
}
// button is
// pressed
navigationButtons.add(addButton("<< ", 0, row, new TAction() {
+ @Override
public void DO() {
setChapter(0);
}
}));
navigationButtons.add(addButton("< ", 4, row, new TAction() {
+ @Override
public void DO() {
setChapter(TuiReaderStoryWindow.this.chapter - 1);
}
}));
navigationButtons.add(addButton("> ", 7, row, new TAction() {
+ @Override
public void DO() {
setChapter(TuiReaderStoryWindow.this.chapter + 1);
}
}));
navigationButtons.add(addButton(">> ", 10, row, new TAction() {
+ @Override
public void DO() {
setChapter(getStory().getChapters().size());
}
pg.setProgress(50);
- if (meta != null && meta.getCover() == null) {
+ if (meta.getCover() == null) {
meta.setCover(getDefaultCover(meta.getSubject()));
}
* @throws IOException
* on I/O error
*/
+ @SuppressWarnings("unused")
protected void preprocess(URL source, InputStream in) throws IOException {
}
if (image != null) {
return new Paragraph(image);
- } else {
- return processPara(line);
}
+
+ return processPara(line);
}
/**
static String[] getImageExt(boolean emptyAllowed) {
if (emptyAllowed) {
return new String[] { "", ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
- } else {
- return new String[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
}
+
+ return new String[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
}
/**
if (prev == car) {
builder.append(closeDoubleQuote);
continue;
- } else {
- builder.append(closeQuote);
}
+
+ builder.append(closeQuote);
}
}
return null;
}
- private String getAuthor(URL source, InputStream in) throws IOException {
+ private String getAuthor(URL source, InputStream in) {
String author = getLine(in, "href=\"/post/show/", 0);
if (author != null) {
String key = "href=\"";
return null;
}
- private String getTitle(InputStream in) throws IOException {
+ private String getTitle(InputStream in) {
String title = getLine(in, "<title>", 0);
if (title != null) {
int pos = title.indexOf('>');
final String key = Integer.toString(i);
final URL value = new URL(source.toString() + "?page=" + i);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return value;
}
+ @Override
public String getKey() {
return key;
}
return true;
}
- private BufferedImage getCover(URL source, InputStream in)
- throws IOException {
+ private BufferedImage getCover(URL source, InputStream in) {
BufferedImage author = null;
String coverLine = getKeyLine(in, "<div id=\"gd1\"", " url(", ")");
if (coverLine != null) {
return tags;
}
- private String getTitle(InputStream in) throws IOException {
+ private String getTitle(InputStream in) {
String siteName = " - E-Hentai Galleries";
String title = getLine(in, "<title>", 0);
final String key = Integer.toString(i + 1);
final URL value = new URL(source.toString() + "?p=" + i);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return value;
}
+ @Override
public String getKey() {
return key;
}
return null;
}
- private List<String> getTags(InputStream in) throws IOException {
+ private List<String> getTags(InputStream in) {
List<String> tags = new ArrayList<String>();
String key = "title=\"Send Private Message\"";
final String chapName = name.trim();
final URL chapURL = new URL(base + i + suffix);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return chapURL;
}
+ @Override
public String getKey() {
return chapName;
}
final String chapName = getTitle(reset(in));
final URL chapURL = source;
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return chapURL;
}
+ @Override
public String getKey() {
return chapName;
}
final URL value = new URL("http://www.fimfiction.net"
+ line);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public String getKey() {
return key;
}
+ @Override
public URL getValue() {
return value;
}
in.close();
in = null;
}
- } else {
- throw new FileNotFoundException(
- "File given as argument does not exists: "
- + infoFile.getAbsolutePath());
}
+
+ throw new FileNotFoundException(
+ "File given as argument does not exists: "
+ + infoFile.getAbsolutePath());
}
private static MetaData createMeta(URL sourceInfoFile, InputStream in,
if (authors.isEmpty()) {
return null;
- } else {
- StringBuilder builder = new StringBuilder();
- for (String author : authors) {
- if (builder.length() > 0) {
- builder.append(", ");
- }
+ }
- builder.append(author);
+ StringBuilder builder = new StringBuilder();
+ for (String author : authors) {
+ if (builder.length() > 0) {
+ builder.append(", ");
}
- return builder.toString();
+ builder.append(author);
}
+
+ return builder.toString();
}
private String getDate(InputStream in) {
final String key = name;
final URL value = new URL(url);
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public String getKey() {
return key;
}
+ @Override
public URL getValue() {
return value;
}
meta.setPublisher("");
meta.setUuid(source.toString());
meta.setLuid("");
- meta.setLang(getLang(source, reset(in))); // default is EN
+ meta.setLang(getLang(reset(in))); // default is EN
meta.setSubject(getSubject(source));
meta.setType(getType().toString());
meta.setImageDocument(false);
}
- private String getLang(URL source, InputStream in) throws IOException {
+ private String getLang(InputStream in) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(in, "UTF-8");
scan.useDelimiter("\\n");
return lang;
}
- private String getTitle(InputStream in) throws IOException {
+ private String getTitle(InputStream in) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(in, "UTF-8");
scan.useDelimiter("\\n");
return scan.next();
}
- private String getAuthor(InputStream in) throws IOException {
+ private String getAuthor(InputStream in) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(in, "UTF-8");
scan.useDelimiter("\\n");
return fixAuthor(author);
}
- private String getDate(InputStream in) throws IOException {
+ private String getDate(InputStream in) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(in, "UTF-8");
scan.useDelimiter("\\n");
return getChapterContent(source, in, 0, null);
}
- private BufferedImage getCover(URL source) throws IOException {
+ private BufferedImage getCover(URL source) {
String path;
try {
path = new File(source.toURI()).getPath();
final URL value = source;
final String key = chapName;
chaps.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return value;
}
+ @Override
public String getKey() {
return key;
}
MetaData meta = new MetaData();
meta.setTitle(getTitle(reset(in)));
- meta.setAuthor(getAuthor(source, reset(in)));
+ meta.setAuthor(getAuthor(reset(in)));
meta.setDate("");
meta.setTags(getTags(reset(in)));
meta.setSource(getSourceName());
return null;
}
- private String getAuthor(URL source, InputStream in) throws IOException {
+ private String getAuthor(InputStream in) {
String author = getLine(in, "class=\"onlinestatus", 0);
if (author != null) {
return StringUtils.unhtml(author).trim();
return null;
}
- private String getTitle(InputStream in) throws IOException {
+ private String getTitle(InputStream in) {
String title = getLine(in, "class=\"sflabel pagetitle", 0);
if (title != null) {
if (title.contains("(series)")) {
final URL value = guest(link);
final String key = StringUtils.unhtml(line).trim();
urls.add(new Entry<String, URL>() {
+ @Override
public URL setValue(URL value) {
return null;
}
+ @Override
public URL getValue() {
return value;
}
+ @Override
public String getKey() {
return key;
}
if (link.contains("?")) {
if (link.contains("/?")) {
return new URL(link.replace("?", "guest?"));
- } else {
- return new URL(link.replace("?", "/guest?"));
}
- } else {
- return new URL(link + "/guest");
+
+ return new URL(link.replace("?", "/guest?"));
}
+
+ return new URL(link + "/guest");
}
}
public void setUp() throws Exception {
super.setUp();
- };
+ }
@Override
public void tearDown() throws Exception {
+ "Fanfan." + "\n" + "\n"
+ "Chapter 2: Chap2" + "\n" + "\n" //
+ "Tulipe." + "\n");
- };
+ }
@Override
public void tearDown() throws Exception {
tmp.delete();
- };
+ }
@Override
public void test() throws Exception {
+ "Fanfan." + "\n" + "\n"
+ "Chapter 2: Chap2" + "\n" + "\n" //
+ "Tulipe." + "\n");
- };
+ }
@Override
public void tearDown() throws Exception {
tmp.delete();
- };
+ }
@Override
public void test() throws Exception {