- }
-
- return tags;
- }
-
- @Override
- public boolean isImageDocument(URL source, InputStream in)
- throws IOException {
- String tag = getInfoTag(source, "IMAGES_DOCUMENT");
- if (tag != null) {
- return tag.trim().toLowerCase().equals("true");
- }
-
- return super.isImageDocument(source, in);
- }
-
- @Override
- protected URL getCover(URL source, InputStream in) {
- File file;
- try {
- file = new File(source.toURI());
- file = new File(file.getPath() + ".info");
- } catch (URISyntaxException e) {
- Instance.syserr(e);
- file = null;
- }
-
- String path = null;
- if (file != null && file.exists()) {
- try {
- InputStream infoIn = new FileInputStream(file);
- try {
- String key = "COVER=";
- String tt = getLine(infoIn, key, 0);
- if (tt != null && !tt.isEmpty()) {
- tt = tt.substring(key.length()).trim();
- if (tt.startsWith("'") && tt.endsWith("'")) {
- tt = tt.substring(1, tt.length() - 1).trim();
- }
-
- URL cover = getImage(source, tt);
- if (cover != null) {
- path = cover.getFile();
- }
- }
- } finally {
- infoIn.close();
- }
- } catch (MalformedURLException e) {
- Instance.syserr(e);
- } catch (IOException e) {
- Instance.syserr(e);