Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- in serverSystem: maxPathLength is now a variable, not a method - upon startup the calculated maximum path length is shown
orbiter128e4ab199fb
diff --git a/source/de/anomic/plasma/plasmaCrawlWorker.java b/source/de/anomic/plasma/plasmaCrawlWorker.javaindex b70ab629f..ae0c225b2 100644--- a/source/de/anomic/plasma/plasmaCrawlWorker.java+++ b/source/de/anomic/plasma/plasmaCrawlWorker.java@@ -358,7 +358,7 @@ public final class plasmaCrawlWorker extends Thread {//long contentLength = res.responseHeader.contentLength();htCache = cacheManager.newEntry(requestDate, depth, url, name, requestHeader, res.status, res.responseHeader, initiator, profile);- if (htCache.cacheFile.getAbsolutePath().length() > serverSystem.maxPathLength()) {+ if (htCache.cacheFile.getAbsolutePath().length() > serverSystem.maxPathLength) {remote.close();log.logInfo("REJECTED URL " + url.toString() + " because path too long '" +cacheManager.cachePath.getAbsolutePath() + "'");diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.javaindex 200d31a42..32588eb55 100644--- a/source/de/anomic/plasma/plasmaHTCache.java+++ b/source/de/anomic/plasma/plasmaHTCache.java@@ -742,7 +742,7 @@ public final class plasmaHTCache {// we cannot match that here in the cache file path and therefore omit writing into the cacheif (this.cacheFile.getParentFile().isFile() || this.cacheFile.isDirectory()) { return "path_ambiguous"; }if (this.cacheFile.toString().indexOf("..") >= 0) { return "path_dangerous"; }- if (this.cacheFile.getAbsolutePath().length() > serverSystem.maxPathLength()) { return "path too long"; }+ if (this.cacheFile.getAbsolutePath().length() > serverSystem.maxPathLength) { return "path too long"; }// -CGI access in request// CGI access makes the page very individual, and therefore not usable in cachesdiff --git a/source/de/anomic/server/serverSystem.java b/source/de/anomic/server/serverSystem.javaindex 6bc002512..50dda18f9 100644--- a/source/de/anomic/server/serverSystem.java+++ b/source/de/anomic/server/serverSystem.java@@ -67,6 +67,9 @@ public final class serverSystem {public static boolean isUnixFS = false;public static boolean canExecUnix = false;+ // calculated system constants+ public static int maxPathLength = 65535;+// Macintosh-specific staticsprivate static Class macMRJFileUtils = null;private static Class macMRJOSType = null;@@ -116,17 +119,15 @@ public final class serverSystem {//e.printStackTrace();macMRJFileUtils = null; macMRJOSType = null;}++ // set up maximum path length accoring to system+ if (systemOS == systemWindows) maxPathLength = 255; else maxPathLength = 65535;}public static boolean isWindows() {return systemOS == systemWindows;}- public static int maxPathLength() {- if (systemOS == systemWindows) return 255;- return 65535;- }-public static Object getMacOSTS(String s) {if ((isMacArchitecture) && (macMRJFileUtils != null)) try {if ((s == null) || (s.equals(blankTypeString))) return macMRJOSNullObj;diff --git a/source/yacy.java b/source/yacy.javaindex 890dc3ffa..6251a37f4 100644--- a/source/yacy.java+++ b/source/yacy.java@@ -221,6 +221,7 @@ public final class yacy {serverLog.logConfig("STARTUP", "java version " + System.getProperty("java.version", "no-java-version"));serverLog.logConfig("STARTUP", "Application Root Path: " + homePath);serverLog.logConfig("STARTUP", "Time Zone: UTC" + serverDate.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis());+ serverLog.logConfig("STARTUP", "Maximum file systen path length: " + serverSystem.maxPathLength);// create data folderfinal File dataFolder = new File(homePath, "DATA");