From 83378773e9fb2b64cfbe685930be3b2f11f31c91 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 23 Jul 2003 09:19:58 +0000 Subject: [PATCH] Patch from Andreas Bolka to use appHome and dbHome properties --- src/helma/framework/core/Application.java | 6 ++---- src/helma/main/Server.java | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 23fee26d..8c961338 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -199,13 +199,11 @@ public final class Application implements IPathElement, Runnable { // if appDir and dbDir weren't explicitely passed, use the // standard subdirectories of the Hop home directory if (appDir == null) { - appDir = new File(home, "apps"); - appDir = new File(appDir, name); + appDir = new File(server.getAppsHome(), name); } if (dbDir == null) { - dbDir = new File(home, "db"); - dbDir = new File(dbDir, name); + dbDir = new File(server.getDbHome(), name); } // get system-wide properties diff --git a/src/helma/main/Server.java b/src/helma/main/Server.java index ec062ca9..ce612165 100644 --- a/src/helma/main/Server.java +++ b/src/helma/main/Server.java @@ -673,15 +673,30 @@ public class Server implements IPathElement, Runnable { * @return ... */ public File getAppsHome() { - String appHome = sysProps.getProperty("appHome"); + String appHome = sysProps.getProperty("appHome", ""); - if ((appHome != null) && !"".equals(appHome.trim())) { + if (appHome.trim().length() != 0) { return new File(appHome); } else { return new File(hopHome, "apps"); } } + /** + * + * + * @return ... + */ + public File getDbHome() { + String dbHome = sysProps.getProperty("dbHome", ""); + + if (dbHome.trim().length() != 0) { + return new File(dbHome); + } else { + return new File(hopHome, "db"); + } + } + /** * *