jakarta-ecs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Fleming <flem...@cs.washington.edu>
Subject ECSDefaults: ClassLoader.getResourceAsStream instead of FileInputStream?
Date Wed, 03 Aug 2005 20:04:08 GMT
Greetings,

I suggest the following change to 
ecs-1.4.2-src/src/java/org/apache/ecs/ECSDefaults.java:

@@ -243,7 +243,9 @@
             {
                 resource = ResourceBundle.getBundle("org.apache.ecs.ecs");
             } else {
-                resource = new java.util.PropertyResourceBundle(new 
java.io.FileInputStream(props));
+            ClassLoader classLoader = 
Thread.currentThread().getContextClassLoader();
+            java.io.InputStream inputStream = 
classLoader.getResourceAsStream(props);
+                resource = new 
java.util.PropertyResourceBundle(inputStream);
             }
 
             // set up variables

----------

... or some variant thereof.

For me this made it easier to use ECS in a servlet with a customized 
properties file, which, incidentally, was only necessary because ECS 
generates invalid XML by default (i.e. it does not translate "&" into 
"&amp;"), but that's a separate gripe...  anyway is there some list of 
known bugs/issues?  I did not see ECS in bugzilla or JIRA.

Thanks,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-dev-help@jakarta.apache.org


Mime
View raw message