From e9cf02914c7f2a64ab1ff3b228c0db57228728f9 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 15 Mar 2007 16:23:22 +0000 Subject: [PATCH] * Implement app.getAppsProperties() to return the subset of apps.properties relevant to the current application. --- src/helma/framework/core/ApplicationBean.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 363c58bd..19b74bb9 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -22,6 +22,7 @@ import helma.util.CronJob; import helma.util.SystemMap; import helma.util.WrappedMap; import helma.framework.repository.*; +import helma.main.Server; import java.io.File; import java.io.Serializable; @@ -491,6 +492,18 @@ public class ApplicationBean implements Serializable { return app.getDbSource(name); } + /** + * Get a wrapper around the app's apps.properties + * + * @return a readonly wrapper around the application's apps.properties + */ + public Map getAppsProperties() { + Server server = Server.getServer(); + if (server == null) + return new SystemMap(); + return new WrappedMap(server.getAppsProperties(app.getName()), true); + } + /** * Get an array of this app's prototypes *