package org.de.metux.treebuild.base;
import java.io.File;
+import java.util.Properties;
import org.de.metux.util.StrUtil;
+import org.de.metux.datasource.Cached_TextDB_Loader;
import org.de.metux.propertylist.IPropertylist;
import org.de.metux.propertylist.Propertylist;
import org.de.metux.propertylist.EIllegalValue;
@@ -16,6 +18,16 @@ public class TreebuildConfig
public ToolConfig unitool;
public static final String cf_unitool_config = "@TARGET/unitool-config";
+ private Cached_TextDB_Loader textdb_loader = new Cached_TextDB_Loader();
+
+ private boolean __load_properties_top(String filename)
+ {
+ Properties pr = textdb_loader.load(filename);
+ if (pr == null)
+ return false;
+ conf.loadProperties_top(pr);
+ return true;
+ }
public TreebuildConfig(File f)
throws EPIException
@@ -23,7 +35,7 @@ public class TreebuildConfig
String filename = f.getAbsolutePath();
System.err.println("Using treebuild config file: "+filename);
conf = new Propertylist();
- if (!conf.loadTextDB_top(filename))
+ if (!__load_properties_top(filename))
throw new RuntimeException("coud not load treebuild config: "+filename);
// now load the unitool config