re-insert of migrateSwitchConfigSettings

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1180 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 8862b6ba4b
commit d007d14905

@ -104,8 +104,8 @@ public abstract class serverAbstractSwitch implements serverSwitch {
}
// doing a config settings migration
HashMap migratedSettings = migrateSwitchConfigSettings((HashMap) removedProps);
if (migratedSettings != null) configProps.putAll(migratedSettings);
//HashMap migratedSettings = migrateSwitchConfigSettings((HashMap) removedProps);
//if (migratedSettings != null) configProps.putAll(migratedSettings);
// merge new props from init to config
// this is necessary for migration, when new properties are attached
@ -129,23 +129,6 @@ public abstract class serverAbstractSwitch implements serverSwitch {
// init busy state control
serverJobs = 0;
}
public static HashMap migrateSwitchConfigSettings(HashMap removedSettings) {
if ((removedSettings == null) || (removedSettings.size() == 0)) return null;
HashMap migratedSettings = new HashMap();
if (removedSettings.containsKey("parseableMimeTypes")) {
String value = (String) removedSettings.get("parseableMimeTypes");
migratedSettings.put("parseableMimeTypes.CRAWLER", value);
migratedSettings.put("parseableMimeTypes.PROXY", value);
migratedSettings.put("parseableMimeTypes.URLREDIRECTOR", value);
migratedSettings.put("parseableMimeTypes.ICAP", value);
}
return migratedSettings;
}
// a logger for this switchboard
public void setLog(serverLog log) {

@ -89,7 +89,7 @@ import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacyCore;
/**
* This is the main class of the proxy. Several threads are started from here:
* This is the main class of YaCy. Several threads are started from here:
* <ul>
* <li>one single instance of the plasmaSwitchboard is generated, which itself
* starts a thread with a plasmaHTMLCache object. This object simply counts
@ -201,6 +201,18 @@ public final class yacy {
}
}
public static void migrateSwitchConfigSettings(plasmaSwitchboard sb) {
String value = "";
if ((value = sb.getConfig("parseableMimeTypes","")).length() > 0) {
sb.setConfig("parseableMimeTypes.CRAWLER", value);
sb.setConfig("parseableMimeTypes.PROXY", value);
sb.setConfig("parseableMimeTypes.URLREDIRECTOR", value);
sb.setConfig("parseableMimeTypes.ICAP", value);
}
}
/**
* Starts up the whole application. Sets up all datastructures and starts
* the main threads.
@ -361,6 +373,7 @@ public final class yacy {
//} catch (IOException e) {}
presetPasswords(sb);
migrateSwitchConfigSettings(sb);
// start main threads
try {

Loading…
Cancel
Save