* fix filesize in ftp crawls

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7402 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 14 years ago
parent b2ed4cfaf8
commit ee3cef91e8

@ -231,6 +231,7 @@ public class FTPLoader {
// if the mimetype and file extension is supported we start to download the file
final long size = ftpClient.fileSize(path);
responseHeader.put(HeaderFramework.CONTENT_LENGTH, String.valueOf(size));
String parserError = null;
if ((acceptOnlyParseable && (parserError = TextParser.supports(url, mime)) != null) ||
(size > maxFileSize && maxFileSize >= 0)) {
@ -252,7 +253,7 @@ public class FTPLoader {
responseHeader,
"200",
mp == null ? null : new CrawlProfile(mp),
url.toTokens().getBytes());
null);
return response;
}

@ -241,11 +241,11 @@ public class Response {
}
public long size() {
if (this.content != null) return this.content.length;
if (this.responseHeader != null) {
// take the size from the response header
return this.responseHeader.getContentLength();
}
if (this.content != null) return this.content.length;
// the size is unknown
return -1;
}

Loading…
Cancel
Save