skip creation of unused Bluelist contenttransformer

pull/1/head
reger 10 years ago
parent 321840fde3
commit 28456dfc09

@ -26,6 +26,8 @@ package net.yacy.document.parser.html;
import java.util.TreeSet;
@Deprecated
// TODO: delete candidate, because not in use, (noticed 2014-12-02)
public abstract class AbstractTransformer implements Transformer {
private TreeSet<String> tags0;
@ -65,9 +67,9 @@ public abstract class AbstractTransformer implements Transformer {
public char[] transformTag1(final ContentScraper.Tag tag, final char quotechar) {
return TransformerWriter.genTag1(tag.name, tag.opts, tag.content.getChars(), quotechar);
}
@Override
public synchronized void close() {
public synchronized void close() {
// free resources
this.tags0 = null;
this.tags1 = null;

@ -34,6 +34,8 @@ import java.util.TreeSet;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.kelondro.io.CharBuffer;
@Deprecated
// TODO: delete candidate, because not in use, (noticed 2014-12-02)
public class ContentTransformer extends AbstractTransformer implements Transformer {
// statics: for initialization of the HTMLFilterAbstractTransformer
@ -143,4 +145,4 @@ public class ContentTransformer extends AbstractTransformer implements Transform
super.close();
}
}
}

@ -542,30 +542,4 @@ public final class TransformerWriter extends Writer {
return !this.binaryUnsuspect;
}
public static void main(final String[] args) {
// takes one argument: a file name
if (args.length != 1) return;
// TODO: this does not work at the moment
System.out.println("this does not work at the moment");
System.exit(0);
final char[] buffer = new char[512];
try {
final ContentScraper scraper = new ContentScraper(new DigestURL("http://localhost:8090"), 1000);
final Transformer transformer = new ContentTransformer();
final Reader is = new FileReader(args[0]);
final FileOutputStream fos = new FileOutputStream(new File(args[0] + ".out"));
final Writer os = new TransformerWriter(fos, UTF8.charset, scraper, transformer, false);
int i;
while ((i = is.read(buffer)) > 0) os.write(buffer, 0, i);
os.close();
fos.close();
is.close();
scraper.print();
} catch (final MalformedURLException e) {
ConcurrentLog.logException(e);
} catch (final IOException e) {
ConcurrentLog.logException(e);
}
}
}

@ -79,14 +79,11 @@ import net.yacy.crawler.data.Cache;
import net.yacy.crawler.retrieval.Request;
import net.yacy.crawler.retrieval.Response;
import net.yacy.document.TextParser;
import net.yacy.document.parser.html.ContentTransformer;
import net.yacy.document.parser.html.Transformer;
import net.yacy.kelondro.io.ByteCountOutputStream;
import net.yacy.kelondro.util.FileUtils;
import net.yacy.peers.operation.yacyBuildProperties;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverObjects;
public final class HTTPDProxyHandler {
@ -104,8 +101,6 @@ public final class HTTPDProxyHandler {
private static PrintWriter redirectorWriter = null;
private static BufferedReader redirectorReader = null;
private static Transformer transformer = null;
//private Properties connectionProperties = null;
// creating a logger
private static final ConcurrentLog log = new ConcurrentLog("PROXY");
@ -168,10 +163,6 @@ public final class HTTPDProxyHandler {
log.severe("Unable to configure proxy access logging.",e);
}
// load a transformer
transformer = new ContentTransformer();
transformer.init(new File(sb.getAppPath(), sb.getConfig(SwitchboardConstants.LIST_BLUE, "")).toString());
// load the yellow-list
final String f = sb.getConfig("proxyYellowList", null);
if (f != null) {

Loading…
Cancel
Save