sixcooler 9 years ago
commit 209f502f09

@ -34,6 +34,7 @@ import java.util.Date;
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
@ -92,7 +93,7 @@ public class bzipParser extends AbstractParser implements Parser {
}
zippedContent.close();
out.close();
final String filename = location.getFileName();
// create maindoc for this bzip container, register with supplied url & mime
maindoc = new Document(
location,
@ -101,7 +102,7 @@ public class bzipParser extends AbstractParser implements Parser {
this,
null,
null,
null,
AbstractParser.singleList(filename.isEmpty() ? location.toTokens() : MultiProtocolURL.unescape(filename)), // title
null,
null,
null,

@ -35,6 +35,7 @@ import java.util.zip.GZIPInputStream;
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
@ -90,6 +91,7 @@ public class gzipParser extends AbstractParser implements Parser {
}
zippedContent.close();
out.close();
final String filename = location.getFileName();
// create maindoc for this gzip container, register with supplied url & mime
maindoc = new Document(
location,
@ -98,7 +100,7 @@ public class gzipParser extends AbstractParser implements Parser {
this,
null,
null,
null,
AbstractParser.singleList(filename.isEmpty() ? location.toTokens() : MultiProtocolURL.unescape(filename)), // title
null,
null,
null,

@ -35,6 +35,7 @@ import java.io.OutputStream;
import java.util.Date;
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
@ -62,6 +63,8 @@ public class sevenzipParser extends AbstractParser implements Parser {
final String charset,
final int timezoneOffset,
final IInStream source) throws Parser.Failure, InterruptedException {
final String filename = location.getFileName();
final Document doc = new Document(
location,
mimeType,
@ -69,12 +72,12 @@ public class sevenzipParser extends AbstractParser implements Parser {
this,
null,
null,
AbstractParser.singleList(filename.isEmpty() ? location.toTokens() : MultiProtocolURL.unescape(filename)), // title,
null,
null,
null,
null,
null,
0.0f, 0.0f,
0.0d, 0.0d,
(Object)null,
null,
null,

@ -72,7 +72,8 @@ public class tarParser extends AbstractParser implements Parser {
final int timezoneOffset,
InputStream source) throws Parser.Failure, InterruptedException {
final String ext = MultiProtocolURL.getFileExtension(location.getFileName());
final String filename = location.getFileName();
final String ext = MultiProtocolURL.getFileExtension(filename);
if (ext.equals("gz") || ext.equals("tgz")) {
try {
source = new GZIPInputStream(source);
@ -84,14 +85,14 @@ public class tarParser extends AbstractParser implements Parser {
final TarArchiveInputStream tis = new TarArchiveInputStream(source);
// create maindoc for this bzip container
Document maindoc = new Document(
final Document maindoc = new Document(
location,
mimeType,
charset,
this,
null,
null,
null,
AbstractParser.singleList(filename.isEmpty() ? location.toTokens() : MultiProtocolURL.unescape(filename)), // title
null,
null,
null,

@ -33,6 +33,7 @@ import java.util.zip.ZipInputStream;
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.Parser;
@ -79,15 +80,16 @@ public class zipParser extends AbstractParser implements Parser {
ZipEntry entry;
final ZipInputStream zis = new ZipInputStream(source);
final String filename = location.getFileName();
// create maindoc for this zip container with supplied url and mime
Document maindoc = new Document(
final Document maindoc = new Document(
location,
mimeType,
charset,
this,
null,
null,
null,
AbstractParser.singleList(filename.isEmpty() ? location.toTokens() : MultiProtocolURL.unescape(filename)), // title
null,
null,
null,

Loading…
Cancel
Save