Author: toad
Date: 2008-09-25 23:08:36 +0000 (Thu, 25 Sep 2008)
New Revision: 22842
Modified:
trunk/freenet/src/freenet/node/Node.java
Log:
Move to a more sensible place
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2008-09-25 23:03:35 UTC (rev
22841)
+++ trunk/freenet/src/freenet/node/Node.java 2008-09-25 23:08:36 UTC (rev
22842)
@@ -1601,25 +1601,6 @@
maxStoreKeys = maxTotalKeys / 2;
maxCacheKeys = maxTotalKeys - maxStoreKeys;
- if(File.separatorChar == '/' &&
System.getProperty("os.name").toLowerCase().indexOf("mac os") < 0) {
- securityLevels.addPhysicalThreatLevelListener(new
SecurityLevelListener<SecurityLevels.PHYSICAL_THREAT_LEVEL>() {
-
- public void onChange(PHYSICAL_THREAT_LEVEL
oldLevel, PHYSICAL_THREAT_LEVEL newLevel) {
- try {
- if(newLevel ==
PHYSICAL_THREAT_LEVEL.LOW)
-
nodeConfig.set("storePreallocate", false);
- else
-
nodeConfig.set("storePreallocate", true);
- } catch (NodeNeedRestartException e) {
- // Ignore
- } catch (InvalidConfigValueException e)
{
- // Ignore
- }
- }
-
- });
- }
-
/*
* On Windows, setting the file length normally involves
writing lots of zeros.
* So it's an uninterruptible system call that takes a loooong
time. On OS/X,
@@ -1652,6 +1633,25 @@
);
storePreallocate = nodeConfig.getBoolean("storePreallocate");
+ if(File.separatorChar == '/' &&
System.getProperty("os.name").toLowerCase().indexOf("mac os") < 0) {
+ securityLevels.addPhysicalThreatLevelListener(new
SecurityLevelListener<SecurityLevels.PHYSICAL_THREAT_LEVEL>() {
+
+ public void onChange(PHYSICAL_THREAT_LEVEL
oldLevel, PHYSICAL_THREAT_LEVEL newLevel) {
+ try {
+ if(newLevel ==
PHYSICAL_THREAT_LEVEL.LOW)
+
nodeConfig.set("storePreallocate", false);
+ else
+
nodeConfig.set("storePreallocate", true);
+ } catch (NodeNeedRestartException e) {
+ // Ignore
+ } catch (InvalidConfigValueException e)
{
+ // Ignore
+ }
+ }
+
+ });
+ }
+
if (storeType.equals("salt-hash")) {
initSaltHashFS(suffix);
} else if (storeType.equals("bdb-index")) {