[Yanel-commits] rev 25266 -
public/yanel/trunk/src/core/java/org/wyona/yanel/core/util
michi at wyona.com
michi at wyona.com
Thu Jun 21 00:06:41 CEST 2007
Author: michi
Date: 2007-06-21 00:06:39 +0200 (Thu, 21 Jun 2007)
New Revision: 25266
Modified:
public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java
Log:
get global and resource type htdocs path added
Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java 2007-06-20 21:54:54 UTC (rev 25265)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java 2007-06-20 22:06:39 UTC (rev 25266)
@@ -18,6 +18,7 @@
import org.apache.log4j.Category;
import org.wyona.yanel.core.map.Realm;
+import org.wyona.yanel.core.Resource;
/**
*
@@ -88,4 +89,19 @@
return backToRealm.toString();
}
+ /**
+ * @param resource Resource
+ * @return A string with as many ../ as it needs to get from the resource path to the root of the realm and adds the reservedPrefix and resource-types/resource-type-namespace::resource-type-localname/ to it.
+ */
+ public static String getResourcesHtdocs(Resource resource) {
+ return getGlobalHtdocs(resource) + "resource-types/" + resource.getResourceTypeNamespace() + "::" + resource.getResourceTypeLocalName() + "/";
+ }
+
+ /**
+ * @param resource Resource
+ * @return A string with as many ../ as it needs to get from the resource path to the root of the realm and adds the reservedPrefix to it.
+ */
+ public static String getGlobalHtdocs(Resource resource) {
+ return backToRealm(resource.getPath()) + resource.getYanel().getReservedPrefix() + "/";
+ }
}
More information about the Yanel-commits
mailing list