- in serverSystem: maxPathLength is now a variable, not a method

- upon startup the calculated maximum path length is shown

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1932 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent a37b09e303
commit 128e4ab199

@ -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() + "'");

@ -742,7 +742,7 @@ public final class plasmaHTCache {
// we cannot match that here in the cache file path and therefore omit writing into the cache
if (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 caches

@ -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 statics
private 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;

@ -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 folder
final File dataFolder = new File(homePath, "DATA");

Loading…
Cancel
Save