Author: mvitenkov
Date: 2009-08-21 09:50:00 -0400 (Fri, 21 Aug 2009)
New Revision: 15250
Modified:
branches/community/3.3.X/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/parser/TLDParser.java
Log:
Modified:
branches/community/3.3.X/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/parser/TLDParser.java
===================================================================
---
branches/community/3.3.X/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/parser/TLDParser.java 2009-08-21
12:50:18 UTC (rev 15249)
+++
branches/community/3.3.X/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/parser/TLDParser.java 2009-08-21
13:50:00 UTC (rev 15250)
@@ -4,9 +4,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
public class TLDParser {
@@ -21,13 +18,10 @@
}
public AttributesList getAllAttributes() {
-
- tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
- InputStream input = null;
+ allAttributes.clear();
try {
- input = richfacesUI.getInputStream(tld);
-
- InputStreamReader isr = new InputStreamReader(input);
+
+ Reader isr = new
InputStreamReader(Thread.currentThread().getContextClassLoader().getResource("META-INF/richfaces.tld").openStream());
BufferedReader reader = new BufferedReader(isr);
String line, attr;
Attribute attribute = new Attribute();
@@ -95,12 +89,6 @@
return allAttributes;
}
- public String getExtPath() {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String resource = "META-INF/richfaces.tld";
- return loader.getResource(resource).toString();
- }
-
public String getComponent() {
return component;
}
@@ -108,23 +96,4 @@
public void setComponent(String component) {
this.component = component;
}
-
- public JarFile getRichfacesUI() {
- String temp = null;
- int position;
- try {
- if ((position = getExtPath().indexOf('!')) != -1) {
- if
(System.getProperty("os.name").toLowerCase().startsWith("windows")) {
- temp = getExtPath().substring("jar:file:\\".length(), position);
- } else {
- temp = "/" +
getExtPath().substring("jar:file:/".length(), position);
- }
-
- }
- richfacesUI = new JarFile(temp);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return richfacesUI;
- }
}
Show replies by date