comparison artifact-database/src/main/java/de/intevation/artifactdatabase/Config.java @ 54:c2fc85e55f9f

Applied patch from slt to set the Configuration Folder into the AbsoluteFileName issue59 artifacts/trunk@257 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 21 Oct 2009 11:06:23 +0000
parents ccc6aae25585
children 8cd770330f1b
comparison
equal deleted inserted replaced
53:fecd142b6856 54:c2fc85e55f9f
31 new File(new File(System.getProperty("user.home", 31 new File(new File(System.getProperty("user.home",
32 System.getProperty("user.dir", "."))), ".artifactdb"); 32 System.getProperty("user.dir", "."))), ".artifactdb");
33 33
34 public static final String CONFIG_FILE = "conf.xml"; 34 public static final String CONFIG_FILE = "conf.xml";
35 35
36 public static final String CONFIG_DIR_PLACEHOLDER = "${artifacts.config.dir}";
37
36 private static Document config; 38 private static Document config;
37 39
38 private Config() { 40 private Config() {
39 } 41 }
40 42
56 logger.warn("'" + configDir + "' is not a directory."); 58 logger.warn("'" + configDir + "' is not a directory.");
57 configDir = CONFIG_DIR_DEFAULT; 59 configDir = CONFIG_DIR_DEFAULT;
58 } 60 }
59 61
60 return configDir; 62 return configDir;
63 }
64
65 public static String replaceConfigDir(String path) {
66 String configDir = getConfigDirectory().getAbsolutePath();
67 return path.replace(CONFIG_DIR_PLACEHOLDER, configDir);
61 } 68 }
62 69
63 private static Document loadConfig() { 70 private static Document loadConfig() {
64 71
65 File configDir = getConfigDirectory(); 72 File configDir = getConfigDirectory();

http://dive4elements.wald.intevation.org