replaced o.compareTo() with o.equals()

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@648 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
borg-0300 20 years ago
parent 966c527966
commit 22adb555de

@ -83,7 +83,7 @@ public class ProxyIndexingMonitor_p {
// read values and put them in global settings // read values and put them in global settings
int newProxyPrefetchDepth = Integer.parseInt((String) post.get("proxyPrefetchDepth", "0")); int newProxyPrefetchDepth = Integer.parseInt((String) post.get("proxyPrefetchDepth", "0"));
if (newProxyPrefetchDepth < 0) newProxyPrefetchDepth = 0; if (newProxyPrefetchDepth < 0) newProxyPrefetchDepth = 0;
if (newProxyPrefetchDepth > 25) newProxyPrefetchDepth = 25; // self protection ? if (newProxyPrefetchDepth > 20) newProxyPrefetchDepth = 20; // self protection ?
env.setConfig("proxyPrefetchDepth", Integer.toString(newProxyPrefetchDepth)); env.setConfig("proxyPrefetchDepth", Integer.toString(newProxyPrefetchDepth));
boolean proxyStoreHTCache = ((String) post.get("proxyStoreHTCache", "")).equals("on"); boolean proxyStoreHTCache = ((String) post.get("proxyStoreHTCache", "")).equals("on");
env.setConfig("proxyStoreHTCache", (proxyStoreHTCache) ? "true" : "false"); env.setConfig("proxyStoreHTCache", (proxyStoreHTCache) ? "true" : "false");
@ -93,9 +93,11 @@ public class ProxyIndexingMonitor_p {
oldProxyCache = env.getConfig("proxyCache", "DATA/HTCACHE"); oldProxyCache = env.getConfig("proxyCache", "DATA/HTCACHE");
newProxyCache = ((String) post.get("proxyCache", "DATA/HTCACHE")); newProxyCache = ((String) post.get("proxyCache", "DATA/HTCACHE"));
newProxyCache = newProxyCache.replace('\\', '/'); newProxyCache = newProxyCache.replace('\\', '/');
if (newProxyCache.endsWith("/")) newProxyCache.substring(0, newProxyCache.length() - 1); if (newProxyCache.endsWith("/")) {
File cp = new File(newProxyCache); newProxyCache.substring(0, newProxyCache.length() - 1);
if ((!cp.isDirectory()) && (!cp.isFile())) cp.mkdirs(); }
final File cache = new File(newProxyCache);
if ((!cache.isDirectory()) && (!cache.isFile())) cache.mkdirs();
env.setConfig("proxyCache", newProxyCache); env.setConfig("proxyCache", newProxyCache);
// proxyCacheSize // proxyCacheSize
@ -116,7 +118,7 @@ public class ProxyIndexingMonitor_p {
prop.put("info_caching", (proxyStoreHTCache) ? 1 : 0); prop.put("info_caching", (proxyStoreHTCache) ? 1 : 0);
// proxyCache - only display on change // proxyCache - only display on change
if (oldProxyCache.compareTo(newProxyCache) == 0) { if (oldProxyCache.equals(newProxyCache)) {
prop.put("info_path", 0); prop.put("info_path", 0);
prop.put("info_path_return", oldProxyCache); prop.put("info_path_return", oldProxyCache);
} else { } else {
@ -124,7 +126,7 @@ public class ProxyIndexingMonitor_p {
prop.put("info_path_return", newProxyCache); prop.put("info_path_return", newProxyCache);
} }
// proxyCacheSize - only display on change // proxyCacheSize - only display on change
if (oldProxyCacheSize.compareTo(newProxyCacheSize) == 0) { if (oldProxyCacheSize.equals(newProxyCacheSize)) {
prop.put("info_size", 0); prop.put("info_size", 0);
prop.put("info_size_return", oldProxyCacheSize); prop.put("info_size_return", oldProxyCacheSize);
} else { } else {
@ -134,8 +136,8 @@ public class ProxyIndexingMonitor_p {
// proxyCache, proxyCacheSize we need a restart // proxyCache, proxyCacheSize we need a restart
prop.put("info_restart", 0); prop.put("info_restart", 0);
prop.put("info_restart_return", 0); prop.put("info_restart_return", 0);
if (oldProxyCache.compareTo(newProxyCache) != 0) prop.put("info_restart", 1); if (!oldProxyCache.equals(newProxyCache)) prop.put("info_restart", 1);
if (oldProxyCacheSize.compareTo(newProxyCacheSize) != 0) prop.put("info_restart", 1); if (!oldProxyCacheSize.equals(newProxyCacheSize)) prop.put("info_restart", 1);
} catch (IOException e) { } catch (IOException e) {
prop.put("info", 3); //Error: errmsg prop.put("info", 3); //Error: errmsg

Loading…
Cancel
Save