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

Modified Files:
        ResourceLoader.java 
Log Message:
improved a bit on the toString of ApplicationContextFileUrlStreamReader


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.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- ResourceLoader.java 12 Sep 2008 14:39:29 -0000      1.70
+++ ResourceLoader.java 26 Sep 2008 08:42:40 -0000      1.71
@@ -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.70 2008/09/12 14:39:29 michiel Exp $
+ * @version $Id: ResourceLoader.java,v 1.71 2008/09/26 08:42:40 michiel Exp $
  */
 public class ResourceLoader extends ClassLoader {
 
@@ -1374,12 +1374,27 @@
                         }
                     }
                 } catch (MalformedURLException mfue) {
+                    log.warn(mfue);
                 }
             }
             return null;
         }
         public String toString() {
-            return "" + FILES;
+            StringBuilder bul = new StringBuilder("{");
+            for (Map.Entry<String, String> e : FILES.entrySet()) {
+                if (bul.length() > 1) bul.append(", ");
+                bul.append(e.getKey()).append('=');
+                File f = getFileFromString(e.getValue());
+                bul.append(e.getValue());
+                if (! f.exists()) {
+                    bul.append("(" + f + " does not exist)");
+                } else if (! f.canRead()) {
+                    bul.append("(" + f + " cannot be read)");
+
+                }
+            }
+            bul.append("}");
+            return bul.toString();
         }
     }
 
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to