Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) added changes which were lost *) additional annotations *) additional svn properties *) _no_ functional changes

low0121ee109761fab
diff --git a/source/de/anomic/document/parser/bzipParser.java b/source/de/anomic/document/parser/bzipParser.java
index e60bc9a52..baefa1316 100644
--- a/source/de/anomic/document/parser/bzipParser.java
+++ b/source/de/anomic/document/parser/bzipParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -46,11 +49,15 @@ public class bzipParser extends AbstractParser implements Parser {
* @see #getSupportedMimeTypes()
*/
public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
- static String fileExtensions = "bz2,tbz,tbz2";
+ static final String fileExtensions = "bz2,tbz,tbz2";
static {
SUPPORTED_MIME_TYPES.put("application/x-bzip2",fileExtensions);
SUPPORTED_MIME_TYPES.put("application/bzip2", fileExtensions);
SUPPORTED_MIME_TYPES.put("application/x-bz2", fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/octet-stream",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-bzip",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-compressed",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-stuffit",fileExtensions);
}
/**
@@ -117,6 +124,7 @@ public class bzipParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/docParser.java b/source/de/anomic/document/parser/docParser.java
index 65beb246b..fe7aaf532 100644
--- a/source/de/anomic/document/parser/docParser.java
+++ b/source/de/anomic/document/parser/docParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 24.04.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -43,7 +46,17 @@ public class docParser extends AbstractParser implements Parser {
* @see #getSupportedMimeTypes()
*/
public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
- static { SUPPORTED_MIME_TYPES.put("application/msword","doc"); }
+ static {
+ SUPPORTED_MIME_TYPES.put("application/msword","doc");
+ SUPPORTED_MIME_TYPES.put("application/doc","doc");
+ SUPPORTED_MIME_TYPES.put("appl/text","doc");
+ SUPPORTED_MIME_TYPES.put("application/vnd.msword","doc");
+ SUPPORTED_MIME_TYPES.put("application/vnd.ms-word","doc");
+ SUPPORTED_MIME_TYPES.put("application/winword","doc");
+ SUPPORTED_MIME_TYPES.put("application/word","doc");
+ SUPPORTED_MIME_TYPES.put("application/x-msw6","doc");
+ SUPPORTED_MIME_TYPES.put("application/x-msword","doc");
+ }
/**
* a list of library names that are needed by this parser
@@ -102,6 +115,7 @@ public class docParser extends AbstractParser implements Parser {
return docParser.SUPPORTED_MIME_TYPES;
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/gzipParser.java b/source/de/anomic/document/parser/gzipParser.java
index 611177580..195dc95df 100644
--- a/source/de/anomic/document/parser/gzipParser.java
+++ b/source/de/anomic/document/parser/gzipParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 24.04.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -44,10 +47,19 @@ public class gzipParser extends AbstractParser implements Parser {
* a list of mime types that are supported by this parser class
* @see #getSupportedMimeTypes()
*/
- public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ static final String fileExtensions = "gz,tgz";
static {
- SUPPORTED_MIME_TYPES.put("application/x-gzip","gz,tgz");
- SUPPORTED_MIME_TYPES.put("application/gzip","gz,tgz");
+ SUPPORTED_MIME_TYPES.put("application/x-gzip",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/gzip",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-gunzip",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/gzipped",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/gzip-compressed",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-compressed",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-compress",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("gzip/document",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/octet-stream",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-tar",fileExtensions);
}
/**
@@ -102,6 +114,7 @@ public class gzipParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/html/AbstractScraper.java b/source/de/anomic/document/parser/html/AbstractScraper.java
index a1cf72640..b9ccfe244 100644
--- a/source/de/anomic/document/parser/html/AbstractScraper.java
+++ b/source/de/anomic/document/parser/html/AbstractScraper.java
@@ -1,9 +1,12 @@
-// htmlFilterAbstractScraper.java
+// AbstractScraper.java
// ---------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
-// last major change: 18.02.2004
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// You agree that the Author(s) is (are) not responsible for cost,
// loss of data or any harm that may be caused by usage of this softare or
@@ -92,6 +95,7 @@ public abstract class AbstractScraper implements Scraper {
tags1 = null;
}
+ @Override
protected void finalize() {
close();
}
diff --git a/source/de/anomic/document/parser/html/AbstractTransformer.java b/source/de/anomic/document/parser/html/AbstractTransformer.java
index f418f8fcf..ade4d8000 100644
--- a/source/de/anomic/document/parser/html/AbstractTransformer.java
+++ b/source/de/anomic/document/parser/html/AbstractTransformer.java
@@ -1,9 +1,12 @@
-// htmlFilterAbstractTransformer.java
+// AbstractTransformer.java
// ----------------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
-// last major change: 18.02.2004
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -65,6 +68,7 @@ public abstract class AbstractTransformer implements Transformer {
tags1 = null;
}
+ @Override
protected void finalize() {
close();
}
diff --git a/source/de/anomic/document/parser/html/CharacterCoding.java b/source/de/anomic/document/parser/html/CharacterCoding.java
index 55f0180a7..18da2dedb 100644
--- a/source/de/anomic/document/parser/html/CharacterCoding.java
+++ b/source/de/anomic/document/parser/html/CharacterCoding.java
@@ -1,9 +1,13 @@
-// htmlFilterCharacterCoding.java
+// CharacterCoding.java
// ----------------------------------
// (C) 22.10.2008 by Michael Peter Christen; [email protected]
// first published on http://yacy.net
// Frankfurt, Germany, 2008
//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
+//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
diff --git a/source/de/anomic/document/parser/html/ContentScraper.java b/source/de/anomic/document/parser/html/ContentScraper.java
index a3c7f5354..ac78fe894 100644
--- a/source/de/anomic/document/parser/html/ContentScraper.java
+++ b/source/de/anomic/document/parser/html/ContentScraper.java
@@ -1,4 +1,4 @@
-// htmlFilterContentScraper.java
+// ContentScraper.java
// -----------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
@@ -441,6 +441,7 @@ public class ContentScraper extends AbstractScraper implements Scraper {
* (non-Javadoc)
* @see de.anomic.htmlFilter.htmlFilterScraper#close()
*/
+ @Override
public void close() {
// free resources
super.close();
diff --git a/source/de/anomic/document/parser/html/ContentTransformer.java b/source/de/anomic/document/parser/html/ContentTransformer.java
index 69d79523d..50622d972 100644
--- a/source/de/anomic/document/parser/html/ContentTransformer.java
+++ b/source/de/anomic/document/parser/html/ContentTransformer.java
@@ -1,4 +1,4 @@
-// htmlFilterContentTransformer.java
+// ContentTransformer.java
// ---------------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
@@ -146,6 +146,7 @@ public class ContentTransformer extends AbstractTransformer implements Transform
return text;
}
+ @Override
public char[] transformTag0(final String tagname, final Properties tagopts, final char quotechar) {
if (tagname.equals("img")) {
// check bluelist
@@ -162,12 +163,14 @@ public class ContentTransformer extends AbstractTransformer implements Transform
return TransformerWriter.genTag0(tagname, tagopts, quotechar);
}
+ @Override
public char[] transformTag1(final String tagname, final Properties tagopts, final char[] text, final char quotechar) {
if (bluelistHit(tagopts.getProperty("href","").toCharArray())) return genBlueLetters(text.length);
if (bluelistHit(text)) return genBlueLetters(text.length);
return TransformerWriter.genTag1(tagname, tagopts, text, quotechar);
}
+ @Override
public void close() {
// free resources
super.close();
diff --git a/source/de/anomic/document/parser/html/ImageEntry.java b/source/de/anomic/document/parser/html/ImageEntry.java
index bbcdb3a41..720809e4f 100644
--- a/source/de/anomic/document/parser/html/ImageEntry.java
+++ b/source/de/anomic/document/parser/html/ImageEntry.java
@@ -1,9 +1,12 @@
-// htmlFilterImageEntry.java
+// ImageEntry.java
// -----------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
// Frankfurt, Germany, 2006
-// created 04.04.2006
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -52,10 +55,12 @@ public class ImageEntry implements Comparable<ImageEntry> {
return this.height;
}
+ @Override
public String toString() {
return "{" + url.toString() + ", " + alt + ", " + width + "/" + height + "}";
}
+ @Override
public int hashCode() {
// if htmlFilterImageEntry elements are stored in a TreeSet, the biggest images shall be listed first
// this hash method therefore tries to compute a 'perfect hash' based on the size of the images
@@ -80,6 +85,7 @@ public class ImageEntry implements Comparable<ImageEntry> {
return this.url.toString().compareTo((h).url.toString());
}
+ @Override
public boolean equals(final Object o) {
if(o != null && o instanceof ImageEntry) {
return compareTo((ImageEntry) o) == 0;
diff --git a/source/de/anomic/document/parser/html/Scraper.java b/source/de/anomic/document/parser/html/Scraper.java
index 84ddd105f..82820ce69 100644
--- a/source/de/anomic/document/parser/html/Scraper.java
+++ b/source/de/anomic/document/parser/html/Scraper.java
@@ -1,9 +1,12 @@
-// htmlFilterScraper.java
+// Scraper.java
// ---------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
-// last major change: 18.02.2004
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
diff --git a/source/de/anomic/document/parser/html/ScraperInputStream.java b/source/de/anomic/document/parser/html/ScraperInputStream.java
index f9181d192..d384bd386 100644
--- a/source/de/anomic/document/parser/html/ScraperInputStream.java
+++ b/source/de/anomic/document/parser/html/ScraperInputStream.java
@@ -1,12 +1,12 @@
-// htmlFilterInputStream.java
+// ScraperInputStream.java
// (C) 2005, 2006 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
// first published 2005 on http://www.anomic.de
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// LICENSE
//
diff --git a/source/de/anomic/document/parser/html/ScraperListener.java b/source/de/anomic/document/parser/html/ScraperListener.java
index 1d68fc6d5..3c8bf0b0d 100644
--- a/source/de/anomic/document/parser/html/ScraperListener.java
+++ b/source/de/anomic/document/parser/html/ScraperListener.java
@@ -1,3 +1,27 @@
+// ScraperListener.java
+// ---------------------------
+// (C) by Michael Peter Christen; [email protected]
+// first published on http://www.anomic.de
+// Frankfurt, Germany, 2004
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
package de.anomic.document.parser.html;
import java.util.Properties;
diff --git a/source/de/anomic/document/parser/html/Transformer.java b/source/de/anomic/document/parser/html/Transformer.java
index 4bc8cd176..ef40c91df 100644
--- a/source/de/anomic/document/parser/html/Transformer.java
+++ b/source/de/anomic/document/parser/html/Transformer.java
@@ -1,9 +1,12 @@
-// htmlFilterTransformer.java
+// Transformer.java
// ---------------------------
// (C) by Michael Peter Christen; [email protected]
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004
-// last major change: 18.02.2004
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
diff --git a/source/de/anomic/document/parser/html/TransformerWriter.java b/source/de/anomic/document/parser/html/TransformerWriter.java
index 05b127767..abee65005 100644
--- a/source/de/anomic/document/parser/html/TransformerWriter.java
+++ b/source/de/anomic/document/parser/html/TransformerWriter.java
@@ -4,9 +4,9 @@
// first published on http://www.anomic.de
// Frankfurt, Germany, 2004, 2005
//
-// $LastChangedDate: 2006-09-15 17:01:25 +0200 (Fr, 15 Sep 2006) $
-// $LastChangedRevision: 2598 $
-// $LastChangedBy: theli $
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -351,6 +351,7 @@ public final class TransformerWriter extends Writer {
return tag.length - 1;
}
+ @Override
public void write(final int c) throws IOException {
// System.out.println((char) c);
if ((binaryUnsuspect) && (binaryHint((char)c))) {
@@ -508,6 +509,7 @@ public final class TransformerWriter extends Writer {
}
}
+ @Override
public void write(final char b[]) throws IOException {
write(b, 0, b.length);
}
@@ -526,6 +528,7 @@ public final class TransformerWriter extends Writer {
// if you want to flush all, call close() at end of writing;
}
+ @Override
protected void finalize() throws IOException {
// if we are forced to close, we of course flush the buffer first,
// then close the connection
diff --git a/source/de/anomic/document/parser/mimeTypeParser.java b/source/de/anomic/document/parser/mimeTypeParser.java
index e9fc1c8e7..58baa2f97 100644
--- a/source/de/anomic/document/parser/mimeTypeParser.java
+++ b/source/de/anomic/document/parser/mimeTypeParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -107,6 +110,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
}
@SuppressWarnings("unchecked")
+ @Override
public Document parse(final yacyURL location, String mimeType, final String charset, final File sourceFile) throws ParserException, InterruptedException {
final String orgMimeType = mimeType;
@@ -185,6 +189,7 @@ public class mimeTypeParser extends AbstractParser implements Parser {
return mimeTypeParser.SUPPORTED_MIME_TYPES;
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/odtParser.java b/source/de/anomic/document/parser/odtParser.java
index 364ea9209..1d47f8f38 100644
--- a/source/de/anomic/document/parser/odtParser.java
+++ b/source/de/anomic/document/parser/odtParser.java
@@ -1,4 +1,4 @@
-//zipParser.java
+//odtParser.java
//------------------------
//part of YaCy
//(C) by Michael Peter Christen; [email protected]
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -81,6 +84,7 @@ public class odtParser extends AbstractParser implements Parser {
return SUPPORTED_MIME_TYPES;
}
+ @Override
public Document parse(final yacyURL location, final String mimeType, final String charset, final File dest) throws ParserException, InterruptedException {
Writer writer = null;
@@ -225,6 +229,7 @@ public class odtParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/pdfParser.java b/source/de/anomic/document/parser/pdfParser.java
index 80342b7c1..334f311cf 100644
--- a/source/de/anomic/document/parser/pdfParser.java
+++ b/source/de/anomic/document/parser/pdfParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 24.04.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -54,7 +57,14 @@ public class pdfParser extends AbstractParser implements Parser {
* @see #getSupportedMimeTypes()
*/
public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
- static { SUPPORTED_MIME_TYPES.put("application/pdf","pdf"); }
+ static {
+ SUPPORTED_MIME_TYPES.put("application/pdf","pdf");
+ SUPPORTED_MIME_TYPES.put("application/x-pdf","pdf");
+ SUPPORTED_MIME_TYPES.put("application/acrobat","pdf");
+ SUPPORTED_MIME_TYPES.put("applications/vnd.pdf","pdf");
+ SUPPORTED_MIME_TYPES.put("text/pdf","pdf");
+ SUPPORTED_MIME_TYPES.put("text/x-pdf","pdf");
+ }
/**
* a list of library names that are needed by this parser
@@ -190,6 +200,7 @@ public class pdfParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/pptParser.java b/source/de/anomic/document/parser/pptParser.java
index f1c46f187..37e333ae0 100644
--- a/source/de/anomic/document/parser/pptParser.java
+++ b/source/de/anomic/document/parser/pptParser.java
@@ -11,7 +11,6 @@
// $LastChangedRevision$
// $LastChangedBy$
//
-//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2 of the License, or
@@ -46,12 +45,18 @@ public class pptParser extends AbstractParser implements Parser {
* a list of mime types that are supported by this parser class
* @see #getSupportedMimeTypes()
*/
- public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ static final String fileExtensions = "ppt,pps";
static {
- SUPPORTED_MIME_TYPES.put("application/mspowerpoint","ppt,pps");
- SUPPORTED_MIME_TYPES.put("application/powerpoint","ppt,pps");
- SUPPORTED_MIME_TYPES.put("application/vnd.ms-powerpoint","ppt,pps");
- }
+ SUPPORTED_MIME_TYPES.put("application/mspowerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/powerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/vnd.ms-powerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/ms-powerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/mspowerpnt",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/vnd-mspowerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-powerpoint",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/x-m",fileExtensions);
+ }
/**
* a list of library names that are needed by this parser
diff --git a/source/de/anomic/document/parser/psParser.java b/source/de/anomic/document/parser/psParser.java
index 0f2d6885d..0efae22b6 100644
--- a/source/de/anomic/document/parser/psParser.java
+++ b/source/de/anomic/document/parser/psParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2007
//
//this file is contributed by Martin Thelian
-//last major change: 15.09.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -48,8 +51,10 @@ public class psParser extends AbstractParser implements Parser {
*/
public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
static {
- SUPPORTED_MIME_TYPES.put("application/postscript","ps");
- SUPPORTED_MIME_TYPES.put("text/postscript","ps");
+ SUPPORTED_MIME_TYPES.put("application/ps","ps");
+ SUPPORTED_MIME_TYPES.put("application/x-postscript","ps");
+ SUPPORTED_MIME_TYPES.put("application/x-ps","ps");
+ SUPPORTED_MIME_TYPES.put("application/x-postscript-not-eps","ps");
}
/**
@@ -58,7 +63,7 @@ public class psParser extends AbstractParser implements Parser {
*/
private static final String[] LIBX_DEPENDENCIES = new String[] {};
- private static Object modeScan = new Object();
+ private final static Object modeScan = new Object();
private static boolean modeScanDone = false;
private static String parserMode = "java";
@@ -96,6 +101,7 @@ public class psParser extends AbstractParser implements Parser {
}
+ @Override
public Document parse(final yacyURL location, final String mimeType, final String charset, final File sourceFile) throws ParserException, InterruptedException {
File outputFile = null;
@@ -261,6 +267,7 @@ public class psParser extends AbstractParser implements Parser {
if (execCode != 0) throw new Exception("Unable to convert ps to ascii. ps2ascii returned statuscode " + execCode + "\n" + procErr.toString());
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/rpmParser.java b/source/de/anomic/document/parser/rpmParser.java
index fda6f1d19..aa156e8e1 100644
--- a/source/de/anomic/document/parser/rpmParser.java
+++ b/source/de/anomic/document/parser/rpmParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 20.11.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -90,6 +93,7 @@ public class rpmParser extends AbstractParser implements Parser {
}
}
+ @Override
public Document parse(final yacyURL location, final String mimeType, final String charset, final File sourceFile) throws ParserException, InterruptedException {
RPMFile rpmFile = null;
try {
@@ -155,6 +159,7 @@ public class rpmParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/rssParser.java b/source/de/anomic/document/parser/rssParser.java
index 5baa344e4..552e65ca0 100644
--- a/source/de/anomic/document/parser/rssParser.java
+++ b/source/de/anomic/document/parser/rssParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -56,12 +59,13 @@ public class rssParser extends AbstractParser implements Parser {
* a list of mime types that are supported by this parser class
* @see #getSupportedMimeTypes()
*/
- public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
+ static final String fileExtensions = "xml,rss,rdf";
static {
- SUPPORTED_MIME_TYPES.put("text/rss","xml,rss,rdf");
- SUPPORTED_MIME_TYPES.put("application/rdf+xml","xml,rss,rdf");
- SUPPORTED_MIME_TYPES.put("application/rss+xml","xml,rss,rdf");
- SUPPORTED_MIME_TYPES.put("application/atom+xml","xml,atom");
+ SUPPORTED_MIME_TYPES.put("text/rss",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/rdf+xml",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/rss+xml",fileExtensions);
+ SUPPORTED_MIME_TYPES.put("application/atom+xml",fileExtensions);
}
/**
@@ -182,6 +186,7 @@ public class rssParser extends AbstractParser implements Parser {
return SUPPORTED_MIME_TYPES;
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/rtfParser.java b/source/de/anomic/document/parser/rtfParser.java
index 4fea8ed59..35346b7a6 100644
--- a/source/de/anomic/document/parser/rtfParser.java
+++ b/source/de/anomic/document/parser/rtfParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -46,6 +49,11 @@ public class rtfParser extends AbstractParser implements Parser {
static {
SUPPORTED_MIME_TYPES.put("application/rtf","rtf");
SUPPORTED_MIME_TYPES.put("text/rtf","rtf");
+ SUPPORTED_MIME_TYPES.put("application/x-rtf","rtf");
+ SUPPORTED_MIME_TYPES.put("text/richtext","rtf");
+ SUPPORTED_MIME_TYPES.put("application/msword","rtf");
+ SUPPORTED_MIME_TYPES.put("application/doc","rtf");
+ SUPPORTED_MIME_TYPES.put("application/x-soffice","rtf");
}
/**
diff --git a/source/de/anomic/document/parser/sevenzipParser.java b/source/de/anomic/document/parser/sevenzipParser.java
index 5261a23cc..2c3b4e711 100644
--- a/source/de/anomic/document/parser/sevenzipParser.java
+++ b/source/de/anomic/document/parser/sevenzipParser.java
@@ -6,7 +6,11 @@
// Frankfurt, Germany, 2004
//
// This file ist contributed by Franz Brausze
-//
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
+//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
@@ -98,11 +102,13 @@ public class sevenzipParser extends AbstractParser implements Parser {
}
}
+ @Override
public Document parse(final yacyURL location, final String mimeType, final String charset,
final byte[] source) throws ParserException, InterruptedException {
return parse(location, mimeType, charset, new ByteArrayIInStream(source), Parser.MAX_KEEP_IN_MEMORY_SIZE - source.length);
}
+ @Override
public Document parse(final yacyURL location, final String mimeType, final String charset,
final File sourceFile) throws ParserException, InterruptedException {
try {
@@ -150,6 +156,7 @@ public class sevenzipParser extends AbstractParser implements Parser {
this.prefix = prefix;
}
+ @Override
public void PrepareOperation(final int arg0) {
this.extractMode = (arg0 == IInArchive.NExtract_NAskMode_kExtract);
switch (arg0) {
@@ -165,6 +172,7 @@ public class sevenzipParser extends AbstractParser implements Parser {
}
}
+ @Override
public void SetOperationResult(final int arg0) throws IOException {
if (arg0 != IInArchive.NExtract_NOperationResult_kOK) {
this.NumErrors++;
@@ -207,6 +215,7 @@ public class sevenzipParser extends AbstractParser implements Parser {
}
}
+ @Override
public OutputStream GetStream(final int index, final int askExtractMode) throws IOException {
final SevenZipEntry item = super.archiveHandler.getEntry(index);
super.filePath = item.getName();
@@ -260,6 +269,7 @@ public class sevenzipParser extends AbstractParser implements Parser {
return this.sbais.read();
}
+ @Override
public int read(final byte[] b, final int off, final int len) throws IOException {
return this.sbais.read(b, off, len);
}
diff --git a/source/de/anomic/document/parser/swfParser.java b/source/de/anomic/document/parser/swfParser.java
index 0751bb8f1..5b2dfefe0 100644
--- a/source/de/anomic/document/parser/swfParser.java
+++ b/source/de/anomic/document/parser/swfParser.java
@@ -48,6 +48,8 @@ public class swfParser extends AbstractParser implements Parser {
static {
SUPPORTED_MIME_TYPES.put("application/x-shockwave-flash","swf");
SUPPORTED_MIME_TYPES.put("application/x-shockwave-flash2-preview","swf");
+ SUPPORTED_MIME_TYPES.put("application/futuresplash","swf");
+ SUPPORTED_MIME_TYPES.put("image/vnd.rn-realflash","swf");
}
/**
diff --git a/source/de/anomic/document/parser/tarParser.java b/source/de/anomic/document/parser/tarParser.java
index 1ffa672db..6ef630e01 100644
--- a/source/de/anomic/document/parser/tarParser.java
+++ b/source/de/anomic/document/parser/tarParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -60,6 +63,10 @@ public class tarParser extends AbstractParser implements Parser {
static {
SUPPORTED_MIME_TYPES.put("application/x-tar","tar");
SUPPORTED_MIME_TYPES.put("application/tar","tar");
+ SUPPORTED_MIME_TYPES.put("applicaton/x-gtar","tar");
+ SUPPORTED_MIME_TYPES.put("multipart/x-tar","tar");
+ SUPPORTED_MIME_TYPES.put("application/x-compress","tar");
+ SUPPORTED_MIME_TYPES.put("application/x-compressed","tar");
}
/**
@@ -227,6 +234,7 @@ public class tarParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/vcfParser.java b/source/de/anomic/document/parser/vcfParser.java
index cf0ed4d34..ef5f054c7 100644
--- a/source/de/anomic/document/parser/vcfParser.java
+++ b/source/de/anomic/document/parser/vcfParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 20.11.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -61,8 +64,13 @@ public class vcfParser extends AbstractParser implements Parser {
public static final Hashtable<String, String> SUPPORTED_MIME_TYPES = new Hashtable<String, String>();
static {
SUPPORTED_MIME_TYPES.put("text/x-vcard","vcf");
- SUPPORTED_MIME_TYPES.put("application/vcard","vcf");
- }
+ SUPPORTED_MIME_TYPES.put("application/vcard","vcf");
+ SUPPORTED_MIME_TYPES.put("text/anytext","vcf");
+ SUPPORTED_MIME_TYPES.put("text/directory","vcf");
+ SUPPORTED_MIME_TYPES.put("application/x-versit","vcf");
+ SUPPORTED_MIME_TYPES.put("text/x-versit","vcf");
+ SUPPORTED_MIME_TYPES.put("text/x-vcalendar","vcf");
+ }
/**
* a list of library names that are needed by this parser
@@ -244,6 +252,7 @@ public class vcfParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();
diff --git a/source/de/anomic/document/parser/xlsParser.java b/source/de/anomic/document/parser/xlsParser.java
index 72096fe76..62ff94943 100644
--- a/source/de/anomic/document/parser/xlsParser.java
+++ b/source/de/anomic/document/parser/xlsParser.java
@@ -64,6 +64,9 @@ public class xlsParser extends AbstractParser implements Parser, HSSFListener {
SUPPORTED_MIME_TYPES.put("application/vnd.ms-excel","xls");
SUPPORTED_MIME_TYPES.put("application/x-excel","xls");
SUPPORTED_MIME_TYPES.put("application/x-msexcel","xls");
+ SUPPORTED_MIME_TYPES.put("application/x-ms-excel","xls");
+ SUPPORTED_MIME_TYPES.put("application/x-dos_ms_excel","xls");
+ SUPPORTED_MIME_TYPES.put("application/xls","xls");
}
/**
diff --git a/source/de/anomic/document/parser/xml/RSSFeed.java b/source/de/anomic/document/parser/xml/RSSFeed.java
index e58411c83..94111658e 100644
--- a/source/de/anomic/document/parser/xml/RSSFeed.java
+++ b/source/de/anomic/document/parser/xml/RSSFeed.java
@@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// LICENSE
//
diff --git a/source/de/anomic/document/parser/xml/RSSReader.java b/source/de/anomic/document/parser/xml/RSSReader.java
index f7aab32cc..ae2b7b701 100644
--- a/source/de/anomic/document/parser/xml/RSSReader.java
+++ b/source/de/anomic/document/parser/xml/RSSReader.java
@@ -1,12 +1,12 @@
-// rssReader.java
+// RSSReader.java
// (C) 2007 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
// first published 16.07.2007 on http://yacy.net
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// LICENSE
//
@@ -122,6 +122,7 @@ public class RSSReader extends DefaultHandler {
return reader;
}
+ @Override
public void startElement(final String uri, final String name, final String tag, final Attributes atts) throws SAXException {
if ("channel".equals(tag)) {
item = new RSSMessage();
@@ -134,6 +135,7 @@ public class RSSReader extends DefaultHandler {
}
}
+ @Override
public void endElement(final String uri, final String name, final String tag) {
if (tag == null) return;
if ("channel".equals(tag)) {
@@ -159,6 +161,7 @@ public class RSSReader extends DefaultHandler {
}
}
+ @Override
public void characters(final char ch[], final int start, final int length) {
if (parsingItem || parsingChannel) {
buffer.append(ch, start, length);
diff --git a/source/de/anomic/document/parser/xml/opensearchdescriptionReader.java b/source/de/anomic/document/parser/xml/opensearchdescriptionReader.java
index 34f1bc56f..a3ad669ac 100644
--- a/source/de/anomic/document/parser/xml/opensearchdescriptionReader.java
+++ b/source/de/anomic/document/parser/xml/opensearchdescriptionReader.java
@@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
// LICENSE
//
@@ -169,6 +169,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
return reader;
}
+ @Override
public void startElement(final String uri, final String name, final String tag, final Attributes atts) throws SAXException {
if ("channel".equals(tag)) {
channel = new Item();
@@ -176,6 +177,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
}
}
+ @Override
public void endElement(final String uri, final String name, final String tag) {
if (tag == null) return;
if ("channel".equals(tag)) {
@@ -187,6 +189,7 @@ public class opensearchdescriptionReader extends DefaultHandler {
}
}
+ @Override
public void characters(final char ch[], final int start, final int length) {
if (parsingChannel) {
buffer.append(ch, start, length);
diff --git a/source/de/anomic/document/parser/zipParser.java b/source/de/anomic/document/parser/zipParser.java
index e88d87d1e..013abc0dc 100644
--- a/source/de/anomic/document/parser/zipParser.java
+++ b/source/de/anomic/document/parser/zipParser.java
@@ -6,7 +6,10 @@
//Frankfurt, Germany, 2005
//
//this file is contributed by Martin Thelian
-//last major change: 16.05.2005
+//
+// $LastChangedDate$
+// $LastChangedRevision$
+// $LastChangedBy$
//
//This program is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
@@ -59,6 +62,10 @@ public class zipParser extends AbstractParser implements Parser {
SUPPORTED_MIME_TYPES.put("application/zip","zip");
SUPPORTED_MIME_TYPES.put("application/x-zip","zip");
SUPPORTED_MIME_TYPES.put("application/x-zip-compressed","zip");
+ SUPPORTED_MIME_TYPES.put("application/octet-stream","zip");
+ SUPPORTED_MIME_TYPES.put("application/x-compress","zip");
+ SUPPORTED_MIME_TYPES.put("application/x-compressed","zip");
+ SUPPORTED_MIME_TYPES.put("multipart/x-zip","zip");
SUPPORTED_MIME_TYPES.put("application/java-archive","jar");
}
@@ -211,6 +218,7 @@ public class zipParser extends AbstractParser implements Parser {
}
}
+ @Override
public void reset() {
// Nothing todo here at the moment
super.reset();