[Yanel-commits] rev 37248 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/util

simon at wyona.com simon at wyona.com
Thu Jun 26 16:52:12 CEST 2008


Author: simon
Date: 2008-06-26 16:52:11 +0200 (Thu, 26 Jun 2008)
New Revision: 37248

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java
Log:
added new method of getting resource-typeHtdocs. the new format is reserved-prefix/resource-types/http:%2f%2fwww.name%2fspace%3a%3aresourcename/htdocPath...
the old one (reserved-prefix/resource-types/http://www.name/space::resourcename/htdocPath) still works but is deprecated.

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	2008-06-26 14:50:54 UTC (rev 37247)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/util/PathUtil.java	2008-06-26 14:52:11 UTC (rev 37248)
@@ -92,6 +92,7 @@
     /**
      * @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. 
+     * @deprecated 
      */
     public static String getResourcesHtdocsPath(Resource resource) {
         return getGlobalHtdocsPath(resource) + "resource-types/" + resource.getResourceTypeNamespace() + "::" + resource.getResourceTypeLocalName() + "/";
@@ -99,6 +100,14 @@
 
     /**
      * @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%3a%3aresource-type-localname/ to it. wheras the resource-type-universalname is urlencoded.
+     */
+    public static String getResourcesHtdocsPathURLencoded(Resource resource) {
+        return getGlobalHtdocsPath(resource) + "resource-types/" + resource.getResourceTypeNamespace().replaceAll("/", "%2f") + "%3a%3a" + 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 getGlobalHtdocsPath(Resource resource) {



More information about the Yanel-commits mailing list