diff --git a/.classpath b/.classpath index 10fe6dcd2..0f0590b67 100644 --- a/.classpath +++ b/.classpath @@ -33,7 +33,6 @@ - diff --git a/build.xml b/build.xml index 4c7352e47..5028333a0 100644 --- a/build.xml +++ b/build.xml @@ -175,7 +175,6 @@ - @@ -814,20 +813,6 @@ - - diff --git a/lib/jrpm-SNAPSHOT.jar b/lib/jrpm-SNAPSHOT.jar deleted file mode 100644 index b5ca56888..000000000 Binary files a/lib/jrpm-SNAPSHOT.jar and /dev/null differ diff --git a/source/de/anomic/document/Parser.java b/source/de/anomic/document/Parser.java index f2b136905..fc06420c5 100644 --- a/source/de/anomic/document/Parser.java +++ b/source/de/anomic/document/Parser.java @@ -47,7 +47,6 @@ import de.anomic.document.parser.odtParser; import de.anomic.document.parser.pdfParser; import de.anomic.document.parser.pptParser; import de.anomic.document.parser.psParser; -import de.anomic.document.parser.rpmParser; import de.anomic.document.parser.rssParser; import de.anomic.document.parser.rtfParser; import de.anomic.document.parser.sevenzipParser; @@ -85,7 +84,6 @@ public final class Parser { initParser(new pdfParser()); initParser(new pptParser()); initParser(new psParser()); - initParser(new rpmParser()); initParser(new rssParser()); initParser(new rtfParser()); initParser(new sevenzipParser()); diff --git a/source/de/anomic/document/parser/rpmParser.java b/source/de/anomic/document/parser/rpmParser.java deleted file mode 100644 index f9550f1b9..000000000 --- a/source/de/anomic/document/parser/rpmParser.java +++ /dev/null @@ -1,182 +0,0 @@ -//rpmParser.java -//------------------------ -//part of YaCy -//(C) by Michael Peter Christen; mc@yacy.net -//first published on http://www.anomic.de -//Frankfurt, Germany, 2005 -// -//this file is contributed by Martin Thelian -// -// $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; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - -import com.jguild.jrpm.io.RPMFile; -import com.jguild.jrpm.io.datatype.DataTypeIf; - -import de.anomic.crawler.retrieval.HTTPLoader; -import de.anomic.document.AbstractParser; -import de.anomic.document.Idiom; -import de.anomic.document.ParserException; -import de.anomic.document.Document; -import de.anomic.http.httpClient; -import de.anomic.http.httpHeader; -import de.anomic.http.httpRequestHeader; -import de.anomic.kelondro.util.FileUtils; -import de.anomic.yacy.yacyURL; - -/** - * @author theli - * - */ -public class rpmParser extends AbstractParser implements Idiom { - - /** - * a list of mime types that are supported by this parser class - * @see #getSupportedMimeTypes() - */ - public static final Set SUPPORTED_MIME_TYPES = new HashSet(); - public static final Set SUPPORTED_EXTENSIONS = new HashSet(); - static { - SUPPORTED_EXTENSIONS.add("rpm"); - SUPPORTED_MIME_TYPES.add("application/x-rpm"); - SUPPORTED_MIME_TYPES.add("application/x-redhat packet manager"); - SUPPORTED_MIME_TYPES.add("application/x-redhat-package-manager"); - } - - public rpmParser() { - super("rpm Parser"); - } - - public Set supportedMimeTypes() { - return SUPPORTED_MIME_TYPES; - } - - public Set supportedExtensions() { - return SUPPORTED_EXTENSIONS; - } - - public Document parse(final yacyURL location, final String mimeType, final String charset, - final InputStream source) throws ParserException { - File dstFile = null; - try { - dstFile = File.createTempFile("rpmParser",".prt"); - FileUtils.copy(source,dstFile); - return parse(location,mimeType,charset,dstFile); - } catch (final Exception e) { - return null; - } finally { - if (dstFile != null) FileUtils.deletedelete(dstFile); - } - } - - @Override - public Document parse(final yacyURL location, final String mimeType, final String charset, final File sourceFile) throws ParserException, InterruptedException { - RPMFile rpmFile = null; - try { - String summary = null, description = null, packager = null, name = sourceFile.getName(); - final HashMap anchors = new HashMap(); - final StringBuilder content = new StringBuilder(); - - // opening the rpm file - rpmFile = new RPMFile(sourceFile); - - // parsing the file - rpmFile.parse(); - - // getting all header names - final String[] headerNames = rpmFile.getTagNames(); - for (int i=0; i