X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Ffeatures%2Fregistry%2FPluginParser.java;fp=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Ffeatures%2Fregistry%2FPluginParser.java;h=5c87d044857b889dd57f323ee7ba12cb6fe44991;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=1575aa1b0821dc8a92df97befa8c2602db186446;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.project/src/org/simantics/project/features/registry/PluginParser.java b/bundles/org.simantics.project/src/org/simantics/project/features/registry/PluginParser.java index 1575aa1b0..5c87d0448 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/features/registry/PluginParser.java +++ b/bundles/org.simantics.project/src/org/simantics/project/features/registry/PluginParser.java @@ -1,75 +1,75 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.project.features.registry; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; -import java.util.jar.Attributes; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.Manifest; -import java.util.logging.Logger; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.equinox.p2.metadata.Version; -import org.eclipse.equinox.p2.metadata.VersionedId; -import org.simantics.databoard.Bindings; -import org.simantics.databoard.Files; -import org.simantics.databoard.binding.Binding; -import org.simantics.databoard.serialization.SerializationException; -import org.simantics.graph.representation.TransferableGraph1; -import org.simantics.project.management.GraphBundleEx; -import org.simantics.utils.strings.StringUtils; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - * A class for parsing plug-in bundle repositories for finding: - *
    - *
  1. bundles that contain transferable graphs (graph.tg) or project feature, - * represented as {@link GraphBundleEx} objects
  2. - *
  3. project feature extensions that contain installGroup definitions, - * represented as {@link GroupReference} objects
  4. - *
- * - *

- * Use {@link #parse(String)} or {@link #parse(File)} to parse a bundle or - * bundles from a directory. After parsing, {@link #getGraphBundles()} and - * {@link #getGroupReferences()} can be used to get what was found during - * parsing. - * - * @author J-P Laine +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Enumeration; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.jar.Attributes; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import java.util.logging.Logger; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionedId; +import org.simantics.databoard.Bindings; +import org.simantics.databoard.Files; +import org.simantics.databoard.binding.Binding; +import org.simantics.databoard.serialization.SerializationException; +import org.simantics.graph.representation.TransferableGraph1; +import org.simantics.project.management.GraphBundleEx; +import org.simantics.utils.strings.StringUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * A class for parsing plug-in bundle repositories for finding: + *

    + *
  1. bundles that contain transferable graphs (graph.tg) or project feature, + * represented as {@link GraphBundleEx} objects
  2. + *
  3. project feature extensions that contain installGroup definitions, + * represented as {@link GroupReference} objects
  4. + *
+ * + *

+ * Use {@link #parse(String)} or {@link #parse(File)} to parse a bundle or + * bundles from a directory. After parsing, {@link #getGraphBundles()} and + * {@link #getGroupReferences()} can be used to get what was found during + * parsing. + * + * @author J-P Laine */ public class PluginParser { protected Logger log = Logger.getLogger(PluginParser.class.toString()); - - protected List graphBundles = new ArrayList(); - - protected Set groupReferences = new TreeSet(); + + protected List graphBundles = new ArrayList(); + + protected Set groupReferences = new TreeSet(); /** * @param args @@ -78,27 +78,27 @@ public class PluginParser { PluginParser tester = new PluginParser(); tester.parse("/home/jplaine/tmp/"); - } - - /** - * @return the list of versioned graph bundles found in the parsed bundle - * repositories so far - */ - public List getGraphBundles() { - return graphBundles; - } - - public Set getGroupReferences() { - return groupReferences; - } - - /** - * @param filename Jar file, or folder that contain jar files - */ - public void parse(String filename) { - parse(new File(filename)); - } - + } + + /** + * @return the list of versioned graph bundles found in the parsed bundle + * repositories so far + */ + public List getGraphBundles() { + return graphBundles; + } + + public Set getGroupReferences() { + return groupReferences; + } + + /** + * @param filename Jar file, or folder that contain jar files + */ + public void parse(String filename) { + parse(new File(filename)); + } + /** * @param root Jar file, or folder that contains jar files */