2002/css-validator/org/w3c/css/css StyleSheetGenerator.java,1.21,1.22

Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv2074/org/w3c/css/css

Modified Files:
	StyleSheetGenerator.java 
Log Message:
also search in full path to jar directory for templates

Index: StyleSheetGenerator.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGenerator.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- StyleSheetGenerator.java	21 Jan 2009 17:46:37 -0000	1.21
+++ StyleSheetGenerator.java	21 Jan 2009 18:16:37 -0000	1.22
@@ -79,10 +79,12 @@
             Velocity.setProperty(Velocity.RESOURCE_LOADER, "file");
             Velocity.addProperty(Velocity.RESOURCE_LOADER, "jar");
             Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".class", "org.apache.velocity.runtime.resource.loader.JarResourceLoader");
-            URL jarFile = StyleSheetGenerator.class.getResource("/css-validator.jar");
-            if(jarFile != null) {
-                Velocity.setProperty( "jar." + Velocity.RESOURCE_LOADER + ".path", "jar:" + jarFile);
+            URL path = StyleSheetGenerator.class.getResource("/");
+            if(path != null) {
+                Velocity.addProperty("file." + Velocity.RESOURCE_LOADER + ".path", path.getFile());
+                Velocity.setProperty( "jar." + Velocity.RESOURCE_LOADER + ".path", "jar:" + path + "css-validator.jar");
             }
+
             Velocity.init();
         } catch(Exception e) {
             System.err.println("Failed to initialize Velocity. Validator might not work as expected.");

Received on Wednesday, 21 January 2009 18:16:49 UTC