|
5 | 5 | import org.apache.velocity.app.Velocity;
|
6 | 6 | import org.apache.velocity.exception.ParseErrorException;
|
7 | 7 | import org.apache.velocity.exception.ResourceNotFoundException;
|
| 8 | +import org.apache.velocity.runtime.RuntimeConstants; |
| 9 | +import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; |
8 | 10 | import org.apache.velocity.tools.ToolManager;
|
9 | 11 | import org.w3c.css.error.ErrorReportHTML;
|
10 | 12 | import org.w3c.css.parser.CssError;
|
@@ -83,17 +85,10 @@ public class StyleSheetGenerator extends StyleReport {
|
83 | 85 | }
|
84 | 86 |
|
85 | 87 | try {
|
86 |
| - Velocity.setProperty(Velocity.RESOURCE_LOADER, "file"); |
87 |
| - Velocity.addProperty(Velocity.RESOURCE_LOADER, "jar"); |
88 |
| - Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".class", |
89 |
| - "org.apache.velocity.runtime.resource.loader.JarResourceLoader"); |
90 |
| - URL path = StyleSheetGenerator.class.getResource("/"); |
91 |
| - if (path != null) { |
92 |
| - Velocity.addProperty("file." + Velocity.RESOURCE_LOADER + |
93 |
| - ".path", path.getFile()); |
94 |
| - Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".path", |
95 |
| - "jar:" + path + "css-validator.jar"); |
96 |
| - } |
| 88 | + Velocity.setProperty(RuntimeConstants.RESOURCE_LOADER, |
| 89 | + "classpath"); |
| 90 | + Velocity.setProperty("classpath.resource.loader.class", |
| 91 | + ClasspathResourceLoader.class.getName()); |
97 | 92 | Velocity.init();
|
98 | 93 | velocityToolManager = new ToolManager();
|
99 | 94 | velocityToolManager.configure("org/w3c/css/css/velocity-tools.xml");
|
|
0 commit comments