From bbe9df2bb3dce85aa8f41b371c0012440231f551 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 25 Oct 2015 03:06:15 +0100 Subject: [PATCH] fix MediawikiImporter for bz2 dump skip reading bz2 file magicbyte to identify bz2 format as inputstream reset would be required. Common compress reads and checks the magicbytes internally and throws ioexception if wrong, making preread obsolete. --- .../net/yacy/document/importer/MediawikiImporter.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/net/yacy/document/importer/MediawikiImporter.java b/source/net/yacy/document/importer/MediawikiImporter.java index b9557f803..d0d64cc72 100644 --- a/source/net/yacy/document/importer/MediawikiImporter.java +++ b/source/net/yacy/document/importer/MediawikiImporter.java @@ -153,16 +153,6 @@ public class MediawikiImporter extends Thread implements Importer { if (p > 0) targetstub = targetstub.substring(0, p); InputStream is = new BufferedInputStream(new FileInputStream(this.sourcefile), 1024 * 1024); if (this.sourcefile.getName().endsWith(".bz2")) { - int b = is.read(); - if (b != 'B') { - try {is.close();} catch (final IOException e) {} - throw new IOException("Invalid bz2 content."); - } - b = is.read(); - if (b != 'Z') { - try {is.close();} catch (final IOException e) {} - throw new IOException("Invalid bz2 content."); - } is = new BZip2CompressorInputStream(is); } else if (this.sourcefile.getName().endsWith(".gz")) { is = new GZIPInputStream(is);