home *** CD-ROM | disk | FTP | other *** search
- import java.io.FileNotFoundException;
- import java.io.InputStream;
- import java.util.LinkedList;
- import java.util.List;
- import java.util.StringTokenizer;
- import java.util.jar.JarFile;
- import java.util.zip.ZipEntry;
- import org.jdom.Document;
- import org.jdom.Element;
- import org.jdom.input.SAXBuilder;
-
- class JDOMAbout$Info {
- // $FF: synthetic field
- private final JDOMAbout this$0;
- String title;
- String version;
- String copyright;
- String description;
- List authors;
- String license;
- String support;
- String website;
-
- JDOMAbout$Info(JDOMAbout this$0) throws Exception {
- this.this$0 = this$0;
- String INFO_FILENAME = "META-INF/info.xml";
- SAXBuilder builder = new SAXBuilder();
- JarFile jarFile = null;
- ZipEntry zipEntry = null;
- String classpath = System.getProperty("java.class.path");
- StringTokenizer tokenizer = new StringTokenizer(classpath, ";:");
-
- while(tokenizer.hasMoreTokens() && zipEntry == null) {
- String token = tokenizer.nextToken();
-
- try {
- jarFile = new JarFile(token);
- zipEntry = jarFile.getEntry("META-INF/info.xml");
- } catch (Exception var15) {
- }
- }
-
- if (zipEntry == null) {
- throw new FileNotFoundException("META-INF/info.xml not found; it should be within the JDOM JAR but isn't");
- } else {
- InputStream in = jarFile.getInputStream(zipEntry);
- Document doc = builder.build(in);
- Element root = doc.getRootElement();
- this.title = root.getChildTextTrim("title");
- this.version = root.getChildTextTrim("version");
- this.copyright = root.getChildTextTrim("copyright");
- this.description = root.getChildTextTrim("description");
- this.license = root.getChildTextTrim("license");
- this.support = root.getChildTextTrim("support");
- this.website = root.getChildTextTrim("web-site");
- List authorElements = root.getChildren("author");
- this.authors = new LinkedList();
-
- for(Element element : authorElements) {
- this$0.getClass();
- JDOMAbout$Author author = new JDOMAbout$Author(this$0);
- author.name = element.getChildTextTrim("name");
- author.email = element.getChildTextTrim("e-mail");
- this.authors.add(author);
- }
-
- }
- }
- }
-