Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Faster appearance of ConfigBasic by bypassing UPNP-scan in case of existing external connects *) Marked two deprecated source-points *) Added possibility to dump words from indexing to file. Should not affect performance in the current form.

(no author)4f4d3d71ddc1
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index 527849e16..aef583fb3 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -103,7 +103,10 @@ public class ConfigBasic {
// scan for Upnp routers
long begin = System.currentTimeMillis();
- boolean upnpRouterFound = config.findUPnPRouter(3000);
+ boolean upnpRouterFound = false;
+ if (yacyCore.seedDB.mySeed.isVirgin() || yacyCore.seedDB.mySeed.isJunior()) {
+ upnpRouterFound = config.findUPnPRouter(3000);
+ }
long end = System.currentTimeMillis();
// if the upnp router scan has taken less than 3 sec, we need to wait
diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java
index 5b701193f..d837ff382 100644
--- a/htroot/WatchCrawler_p.java
+++ b/htroot/WatchCrawler_p.java
@@ -266,6 +266,7 @@ public class WatchCrawler_p {
HashMap hyperlinks = (HashMap) scraper.getAnchors();
// creating a crawler profile
+ /* file.toURL() marked as deprecated per Sun JRE 6 */
plasmaCrawlProfile.entry profile = switchboard.profiles.newEntry(fileName, file.toURL().toString(), newcrawlingfilter, newcrawlingfilter, newcrawlingdepth, newcrawlingdepth, crawlingIfOlder, crawlingDomFilterDepth, crawlingDomMaxPages, crawlingQ, indexText, indexMedia, storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);
// loop through the contained links
diff --git a/source/de/anomic/net/ftpc.java b/source/de/anomic/net/ftpc.java
index 44d537190..4ecc71423 100644
--- a/source/de/anomic/net/ftpc.java
+++ b/source/de/anomic/net/ftpc.java
@@ -639,6 +639,7 @@ public class ftpc {
}
public boolean JAR() {
+ /*Sun proprietary API may be removed in a future Java release*/
sun.tools.jar.Main.main(shift(cmd));
return true;
}
diff --git a/source/de/anomic/plasma/plasmaCondenser.java b/source/de/anomic/plasma/plasmaCondenser.java
index 65d6dd31c..728503925 100644
--- a/source/de/anomic/plasma/plasmaCondenser.java
+++ b/source/de/anomic/plasma/plasmaCondenser.java
@@ -52,6 +52,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.RandomAccessFile;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
@@ -390,6 +391,21 @@ public final class plasmaCondenser {
word = (new String((StringBuffer) wordenum.nextElement())).toLowerCase(); // TODO: does toLowerCase work for non ISO-8859-1 chars?
//System.out.println("PARSED-WORD " + word);
+ //This is useful for testing what YaCy "sees" of a website.
+ if (false) {
+ File f = new File("dump.txt");
+ RandomAccessFile fa = null;
+ try {
+ fa = new RandomAccessFile(f, "rw");
+ fa.seek(fa.length());
+ fa.writeBytes(word);
+ fa.write(160);
+ fa.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
// distinguish punctuation and words
wordlen = word.length();
if ((wordlen == 1) && (htmlFilterContentScraper.punctuation(word.charAt(0)))) {
@@ -450,7 +466,7 @@ public final class plasmaCondenser {
wordInSentenceCounter++;
}
}
- // finnish last sentence
+ // finish last sentence
if (sentence.length() > 0) {
allsentencecounter++;
sentence.insert(0, "."); // append at beginning