rename cutUrlText to shortenURLString;

other little things;

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2635 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 19 years ago
parent af1d89e381
commit 42173462f5

@ -76,7 +76,9 @@ public class index {
boolean authenticated = sb.adminAuthenticated(header) >= 2;
int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);
final boolean indexDistributeGranted = sb.getConfig("allowDistributeIndex", "true").equals("true");
final boolean indexReceiveGranted = sb.getConfig("allowReceiveIndex", "true").equals("true");
final String handover = (post == null) ? "" : post.get("handover", "");
@ -213,7 +215,7 @@ public class index {
prop.put("surftipps_results_" + i + "_recommend_deletelink", "/index.html?");
prop.put("surftipps" + i + "_recommend_recommendlink", "/index.html?");
prop.put("surftipps_results_" + i + "_url", row.getColString(0, null));
prop.put("surftipps_results_" + i + "_urlname", nxTools.cutUrlText(row.getColString(0, null), 60));
prop.put("surftipps_results_" + i + "_urlname", nxTools.shortenURLString(row.getColString(0, null), 60));
prop.put("surftipps_results_" + i + "_title", row.getColString(1, null));
prop.put("surftipps_results_" + i + "_description", row.getColString(2, null));
i++;

@ -55,7 +55,6 @@ package de.anomic.plasma;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import de.anomic.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
@ -74,6 +73,7 @@ import de.anomic.kelondro.kelondroNaturalOrder;
import de.anomic.kelondro.kelondroRAMIndex;
import de.anomic.kelondro.kelondroTree;
import de.anomic.kelondro.kelondroRow;
import de.anomic.net.URL;
import de.anomic.plasma.plasmaHTCache;
import de.anomic.plasma.urlPattern.plasmaURLPattern;
import de.anomic.server.serverCodings;
@ -373,8 +373,8 @@ public final class plasmaCrawlLURL extends indexURL {
final plasmaSwitchboard switchboard = plasmaSwitchboard.getSwitchboard();
final plasmaHTCache cacheManager = switchboard.getCacheManager();
int cnt = 0;
for (int i = getStackSize(tabletype) - 1; i >= (getStackSize(tabletype) - lines); i--) {
int i, cnt = 0;
for (i = getStackSize(tabletype) - 1; i >= (getStackSize(tabletype) - lines); i--) {
initiatorHash = getInitiatorHash(tabletype, i);
executorHash = getExecutorHash(tabletype, i);
// serverLog.logFinest("PLASMA", "plasmaCrawlLURL/genTableProps initiatorHash=" + initiatorHash + " executorHash=" + executorHash);
@ -388,7 +388,7 @@ public final class plasmaCrawlLURL extends indexURL {
url = urle.url();
urlstr = url.toString();
urltxt = nxTools.cutUrlText(urlstr, 72); // shorten the string text like a URL
urltxt = nxTools.shortenURLString(urlstr, 72); // shorten the string text like a URL
cachepath = (url == null) ? "-not-cached-" : cacheManager.getCachePath(url).toString().replace('\\', '/').substring(cacheManager.cachePath.toString().length() + 1);
prop.put("table_indexed_" + cnt + "_dark", (dark) ? 1 : 0);
@ -876,7 +876,8 @@ public final class plasmaCrawlLURL extends indexURL {
plasmaCrawlLURL.Entry entry = (plasmaCrawlLURL.Entry) eiter.next();
totalSearchedUrls++;
if (plasmaSwitchboard.urlBlacklist.isListed(plasmaURLPattern.BLACKLIST_CRAWLER,entry.url())==true || plasmaSwitchboard.urlBlacklist.isListed(plasmaURLPattern.BLACKLIST_DHT,entry.url())==true) {
if (plasmaSwitchboard.urlBlacklist.isListed(plasmaURLPattern.BLACKLIST_CRAWLER, entry.url()) ||
plasmaSwitchboard.urlBlacklist.isListed(plasmaURLPattern.BLACKLIST_DHT, entry.url())) {
lastBlacklistedUrl = entry.url().toString();
lastBlacklistedHash = entry.hash();
serverLog.logFine("URLDBCLEANER", ++blacklistedUrls + " blacklisted (" + ((double)blacklistedUrls/totalSearchedUrls)*100 + "%): " + entry.hash() + " " + entry.url());
@ -912,7 +913,7 @@ public final class plasmaCrawlLURL extends indexURL {
public void pause() {
synchronized(this) {
if(pause == false) {
if (!pause) {
pause = true;
serverLog.logInfo("URLDBCLEANER", "UrldbCleaner-Thread paused");
}
@ -921,7 +922,7 @@ public final class plasmaCrawlLURL extends indexURL {
public void endPause() {
synchronized(this) {
if (pause == true) {
if (pause) {
pause = false;
this.notifyAll();
serverLog.logInfo("URLDBCLEANER", "UrldbCleaner-Thread resumed");

@ -2087,7 +2087,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
prop.put("type_results_" + i + "_url", urlstring);
prop.put("type_results_" + i + "_urlhash", urlhash);
prop.put("type_results_" + i + "_urlhexhash", yacySeed.b64Hash2hexHash(urlhash));
prop.put("type_results_" + i + "_urlname", nxTools.cutUrlText(urlname, 120));
prop.put("type_results_" + i + "_urlname", nxTools.shortenURLString(urlname, 120));
prop.put("type_results_" + i + "_date", dateString(urlentry.moddate()));
prop.put("type_results_" + i + "_ybr", plasmaSearchPreOrder.ybr(urlentry.hash()));
prop.put("type_results_" + i + "_size", Long.toString(urlentry.size()));

@ -153,9 +153,9 @@ public class nxTools {
* @param String like a URL
* @return the shorten or the old String
*/
public static String cutUrlText(String url, int len) {
public static String shortenURLString(String url, int len) {
// This is contributed by Thomas Quella (borg-0300)
if (url == null) { return url; }
if (url == null) { return null; }
int la = url.length();
if (la > len) {
int cpos;

Loading…
Cancel
Save