Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv5357

Modified Files:
        ResourceLoader.java 
Log Message:
toString


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util


Index: ResourceLoader.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/ResourceLoader.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- ResourceLoader.java 11 Jul 2008 19:19:25 -0000      1.56
+++ ResourceLoader.java 11 Jul 2008 19:40:23 -0000      1.57
@@ -97,7 +97,7 @@
  * <p>For property-files, the java-unicode-escaping is undone on loading, and 
applied on saving, so there is no need to think of that.</p>
  * @author Michiel Meeuwissen
  * @since  MMBase-1.8
- * @version $Id: ResourceLoader.java,v 1.56 2008/07/11 19:19:25 michiel Exp $
+ * @version $Id: ResourceLoader.java,v 1.57 2008/07/11 19:40:23 michiel Exp $
  */
 public class ResourceLoader extends ClassLoader {
 
@@ -1296,7 +1296,7 @@
         ApplicationContextFileURLStreamHandler() {
             super(true);
             try {
-                FILES = 
ApplicationContextReader.getProperties("mmbase-config");
+                FILES = ApplicationContextReader.getProperties("mmbase-config" 
 + ResourceLoader.this.context.getPath());
             } catch (javax.naming.NamingException ne) {
                 log.error(ne);
                 FILES = new HashMap<String, String>();
@@ -1304,15 +1304,21 @@
         }
 
         public File getFile(final String in) {
-            String name = FILES.get(in);
 
-            if (name != null && name.startsWith("file:")) {
+            String name = FILES.get(ResourceLoader.this.context.getPath() + 
(in == null ? "" : in));
+
+            if (name != null) {
+                if (name.startsWith("file:")) {
                 try {
                     return new File(new URI(name)); // hff, how cumbersome, to 
translate an URL to a File
                 } catch (URISyntaxException use) {
                     log.warn("" + name + " : " + use.getMessage() , use);
                 }
+                } else {
+                    return new File(name);
+                }
             }
+
             return null;
         }
         public String getName(URL u) {
@@ -1320,6 +1326,9 @@
             String path = u.getPath();
             return l < path.length() ? path.substring(l) : path;
         }
+        public String toString() {
+            return "" + FILES;
+        }
     }
 
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to