svn commit: r567475 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Sun Aug 19 14:23:45 2007
New Revision: 567475

URL: http://svn.apache.org/viewvc?rev=567475&view=rev
Log:
Module manager: compute file URI at startup and not on demand for better performance

Modified:
    lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java

Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java?rev=567475&r1=567474&r2=567475&view=diff
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java (original)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/module/ModuleManagerImpl.java Sun Aug 19 14:23:45 2007
@@ -44,8 +44,7 @@
             baseUri = "context://lenya/modules/" + shortcut;
         }
         else {
-            String path = (String) this.module2src.get(shortcut);
-            baseUri = new File(path).toURI().toString();
+            return (String) this.module2src.get(shortcut);
         }
         return baseUri;
     }
@@ -66,7 +65,8 @@
         for (int i = 0; i < modules.length; i++) {
             String shortcut = modules[i].getAttribute("shortcut");
             String src = modules[i].getAttribute("src");
-            this.module2src.put(shortcut, src);
+            String uri = new File(src).toURI().toString();
+            this.module2src.put(shortcut, uri);
         }
 
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.