From c07fc06de4437a0a53e2791dce418cf771038861 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 26 Nov 2002 17:43:24 +0000 Subject: [PATCH] Add public getters for application and server directory --- src/helma/framework/core/Application.java | 10 +++++++++- src/helma/framework/core/ApplicationBean.java | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 29b048a2..8b727d27 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -1189,10 +1189,18 @@ public final class Application implements IPathElement, Runnable { /** * Return the directory of this application */ - public File getAppDir() { + public File getAppDir() { return appDir; } + /** + * Return the directory of the Helma server + */ + public File getServerDir() { + return home; + } + + /** * Get the DbMapping associated with a prototype name in this application */ diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 6ad61171..cbda48d8 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -1,6 +1,7 @@ package helma.framework.core; import java.io.Serializable; +import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.Enumeration; @@ -185,6 +186,16 @@ public class ApplicationBean implements Serializable { return skinz; } + public String getAppDir () { + return app.getAppDir().getAbsolutePath(); + } + + public String getServerDir () { + File f = app.getServerDir(); + if (f == null) + f = app.getAppDir(); + return f.getAbsolutePath(); + } public String toString() { return "[Application " + app.getName() + "]";