improve yacysearchitem,

prevent allocation of String (modifyURL) if feature not used
pull/1/head
reger 10 years ago
parent 61f75d6019
commit 7e4e9f7e32

@ -146,37 +146,34 @@ public class yacysearchitem {
//prop.putHTML("content_link", resultUrlstring); //prop.putHTML("content_link", resultUrlstring);
// START interaction // START interaction
String modifyURL = resultUrlstring; if (sb.getConfigBool("proxyURL.useforresults", false) && sb.getConfigBool("proxyURL", false)) {
if (sb.getConfigBool("proxyURL.useforresults", false) && sb.getConfigBool("proxyURL", false)) { String modifyURL = resultUrlstring;
// check if url is allowed to view // check if url is allowed to view
if (sb.getConfig("proxyURL.rewriteURLs", "all").equals("all")) { final String tmprewritecfg = sb.getConfig("proxyURL.rewriteURLs", "all");
modifyURL = "./proxy.html?url="+modifyURL; if (tmprewritecfg.equals("all")) {
} modifyURL = "./proxy.html?url=" + resultUrlstring;
} else if (tmprewritecfg.equals("domainlist")) { // check if url is allowed to view
// check if url is allowed to view try {
if (sb.getConfig("proxyURL.rewriteURLs", "all").equals("domainlist")) { if (sb.crawlStacker.urlInAcceptedDomain(new DigestURL(resultUrlstring)) == null) {
try { modifyURL = "./proxy.html?url=" + resultUrlstring;
if (sb.crawlStacker.urlInAcceptedDomain(new DigestURL (modifyURL)) == null) { }
modifyURL = "./proxy.html?url="+modifyURL; } catch (final MalformedURLException e) {
} ConcurrentLog.logException(e);
} catch (final MalformedURLException e) { }
// TODO Auto-generated catch block } else if (tmprewritecfg.equals("yacy")) {
e.printStackTrace(); try {
} if ((new DigestURL(resultUrlstring).getHost().endsWith(".yacy"))) {
} modifyURL = "./proxy.html?url=" + resultUrlstring;
}
if (sb.getConfig("proxyURL.rewriteURLs", "all").equals("yacy")) { } catch (final MalformedURLException e) {
try { ConcurrentLog.logException(e);
if ((new DigestURL (modifyURL).getHost().endsWith(".yacy"))) { }
modifyURL = "./proxy.html?url="+modifyURL; }
} prop.putXML("content_link", modifyURL); // putXML for rss
} catch (final MalformedURLException e) { } else {
// TODO Auto-generated catch block prop.putXML("content_link", resultUrlstring); // putXML for rss
e.printStackTrace(); }
}
}
}
prop.putXML("content_link", modifyURL); // putXML for rss
// prop.putHTML("content_value", Interaction.TripleGet(result.urlstring(), "http://virtual.x/hasvalue", "anonymous")); // prop.putHTML("content_value", Interaction.TripleGet(result.urlstring(), "http://virtual.x/hasvalue", "anonymous"));
// END interaction // END interaction

Loading…
Cancel
Save