[jboss-osgi-commits] JBoss-OSGI SVN: r94087 - in projects/jboss-osgi/projects/aQute/trunk: bnd and 49 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Sep 29 02:52:35 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-29 02:52:33 -0400 (Tue, 29 Sep 2009)
New Revision: 94087

Added:
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/DefaultPackage.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/ant/taskdef.properties
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/classpath/messages.properties
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/changed.txt
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.properties
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.xml
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/bnd.info
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/JPAComponent.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringComponent.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringXMLType.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLType.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLTypeProcessor.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/extract.xsl
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/hibernate.xsl
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/jpa.xsl
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/popup/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/popup/Refresh.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/AWTLayout.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/GridLayout.java
   projects/jboss-osgi/projects/aQute/trunk/libg/
   projects/jboss-osgi/projects/aQute/trunk/libg/.classpath
   projects/jboss-osgi/projects/aQute/trunk/libg/.project
   projects/jboss-osgi/projects/aQute/trunk/libg/.settings/
   projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/projects/aQute/trunk/libg/pom.xml
   projects/jboss-osgi/projects/aQute/trunk/libg/src/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/base64/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/base64/Base64.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/filter/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/filter/Filter.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/DirectoryInputStream.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/TestDirectoryInputStream.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/tag/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/tag/Tag.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/BER.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/PDU.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/Types.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/algorithms
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/classdump/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/classdump/ClassDumper.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.class
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.class
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Instruction.class
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Selector.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/dumpzip/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/dumpzip/DumpZip.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/fileiterator/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/fileiterator/FileIterator.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/generics/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/generics/Create.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/header/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/header/OSGiHeader.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/log/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/log/Logger.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/qtokens/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/reporter/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/reporter/Reporter.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Replacer.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Sed.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/Version.java
   projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/VersionRange.java
   projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/default.perm
   projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/permissions.perm
   projects/jboss-osgi/projects/aQute/trunk/service/
   projects/jboss-osgi/projects/aQute/trunk/service/.classpath
   projects/jboss-osgi/projects/aQute/trunk/service/.project
   projects/jboss-osgi/projects/aQute/trunk/service/.settings/
   projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/projects/aQute/trunk/service/pom.xml
   projects/jboss-osgi/projects/aQute/trunk/service/src/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/Scripter.java
   projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/packageinfo
Modified:
   projects/jboss-osgi/projects/aQute/trunk/bnd/.classpath
   projects/jboss-osgi/projects/aQute/trunk/bnd/pom.xml
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/main/bnd.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/AnnotationReader.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/ComponentDef.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Builder.java
   projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Processor.java
   projects/jboss-osgi/projects/aQute/trunk/pom.xml
Log:
Update sources to trunk

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/.classpath
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/.classpath	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/.classpath	2009-09-29 06:52:33 UTC (rev 94087)
@@ -4,27 +4,7 @@
 	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.core.commands_3.5.0.I20090525-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.core.jobs_3.4.100.v20090429-1800.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.core.resources_3.5.0.v20090512.jar" sourcepath="/usr/java/eclipse-3.5.1/plugins/org.eclipse.core.resources.source_3.5.0.v20090512.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.core.runtime_3.5.0.v20090525.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.debug.core_3.5.0.v20090526-1600.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.debug.ui_3.5.0.v20090603.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.equinox.common_3.5.0.v20090520-1800.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.equinox.registry_3.4.100.v20090520-1800.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jdt.core_3.5.0.v_963.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jdt.debug.ui_3.4.0.v20090527.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jdt.junit_3.5.0.v20090526-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jdt.launching_3.5.0.v20090527.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jdt.ui_3.5.0.v20090604.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jface_3.5.0.I20090525-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.jface.text_3.5.0.v20090602.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.swt.gtk.linux.x86_64_3.5.0.v3550b.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.text_3.5.0.v20090513-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.ui_3.5.0.I20090604-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.ui.editors_3.5.0.v20090527-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.ui.ide_3.5.0.I20090525-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.ui.workbench_3.5.0.I20090603-2000.jar"/>
-	<classpathentry kind="lib" path="/usr/java/eclipse-3.5.1/plugins/org.eclipse.ui.workbench.texteditor_3.5.0.v20090603.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/libg"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/service"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/pom.xml
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/pom.xml	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/pom.xml	2009-09-29 06:52:33 UTC (rev 94087)
@@ -30,7 +30,30 @@
 
   <!-- Dependencies -->
   <dependencies>
+  
+    <!-- aQute -->
     <dependency>
+      <groupId>biz.aQute</groupId>
+      <artifactId>libg</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>biz.aQute</groupId>
+      <artifactId>service</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>biz.aQute</groupId>
+      <artifactId>runtime</artifactId>
+      <version>${version}</version>
+    </dependency>
+
+    <!-- 3rd party -->
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
@@ -38,103 +61,123 @@
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.compendium</artifactId>
     </dependency>
+    
+    <!-- Eclipse -->
     <dependency>
-      <groupId>org.apache.ant</groupId>
-      <artifactId>ant</artifactId>
-    </dependency>
-  
-    <!-- 
-    <dependency>
       <groupId>org.eclipse.core</groupId>
       <artifactId>org.eclipse.core.commands</artifactId>
-      <version>3.2.0.I20060605-1400</version>
+      <version>3.5.0.I20090525-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.core</groupId>
       <artifactId>org.eclipse.core.jobs</artifactId>
-      <version>3.2.0-v20060603</version>
+      <version>3.4.100.v20090429-1800</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.core</groupId>
       <artifactId>org.eclipse.core.resources</artifactId>
-      <version>3.2.0-v20060603</version>
+      <version>3.5.0.v20090512</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.core</groupId>
       <artifactId>org.eclipse.core.runtime</artifactId>
-      <version>3.2.0-v20060603</version>
+      <version>3.5.0.v20090525</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.debug</groupId>
       <artifactId>org.eclipse.debug.core</artifactId>
-      <version>3.2.0.v20060605</version>
+      <version>3.5.0.v20090526-1600</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.debug</groupId>
       <artifactId>org.eclipse.debug.ui</artifactId>
-      <version>3.2.0.v20060605</version>
+      <version>3.5.0.v20090603</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.equinox</groupId>
       <artifactId>org.eclipse.equinox.common</artifactId>
-      <version>3.2.0-v20060603</version>
+      <version>3.5.0.v20090520-1800</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.equinox</groupId>
       <artifactId>org.eclipse.equinox.registry</artifactId>
-      <version>3.2.0-v20060601</version>
+      <version>3.4.100.v20090520-1800</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jdt</groupId>
       <artifactId>org.eclipse.jdt.core</artifactId>
-      <version>3.2.0-v_671</version>
+      <version>3.5.0.v_963</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jdt</groupId>
+      <artifactId>org.eclipse.jdt.debug.ui</artifactId>
+      <version>3.4.0.v20090527</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jdt</groupId>
+      <artifactId>org.eclipse.jdt.junit</artifactId>
+      <version>3.5.0.v20090526-2000</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jdt</groupId>
       <artifactId>org.eclipse.jdt.launching</artifactId>
-      <version>3.2.0.v20060605</version>
+      <version>3.5.0.v20090527</version>
     </dependency>
     <dependency>
+      <groupId>org.eclipse.jdt</groupId>
+      <artifactId>org.eclipse.jdt.ui</artifactId>
+      <version>3.5.0.v20090604</version>
+    </dependency>
+    <dependency>
       <groupId>org.eclipse.jface</groupId>
       <artifactId>org.eclipse.jface</artifactId>
-      <version>3.2.0-I20060605-1400</version>
+      <version>3.5.0.I20090525-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jface</groupId>
       <artifactId>org.eclipse.jface.text</artifactId>
-      <version>3.2.0.v20060605-1400</version>
+      <version>3.5.0.v20090602</version>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.osgi</groupId>
-      <artifactId>org.eclipse.osgi</artifactId>
-      <version>3.2.0-v20060601</version>
+      <groupId>org.eclipse.swt</groupId>
+      <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
+      <version>3.5.0.v3550b</version>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.swt</groupId>
-      <artifactId>org.eclipse.swt.gtk.linux.x86</artifactId>
-      <version>3.2.0.v3232m</version>
+      <groupId>org.eclipse.text</groupId>
+      <artifactId>org.eclipse.text</artifactId>
+      <version>3.5.0.v20090513-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
+      <artifactId>org.eclipse.ui</artifactId>
+      <version>3.5.0.I20090604-2000</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.ui</groupId>
+      <artifactId>org.eclipse.ui.console</artifactId>
+      <version>3.4.0.v20090513</version>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.ui</groupId>
       <artifactId>org.eclipse.ui.editors</artifactId>
-      <version>3.2.0.v20060605-1400</version>
+      <version>3.5.0.v20090527-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
       <artifactId>org.eclipse.ui.ide</artifactId>
-      <version>3.2.0.I20060605-1400</version>
+      <version>3.5.0.I20090525-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
       <artifactId>org.eclipse.ui.workbench</artifactId>
-      <version>3.2.0-I20060605-1400</version>
+      <version>3.5.0.I20090603-2000</version>
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
       <artifactId>org.eclipse.ui.workbench.texteditor</artifactId>
-      <version>3.2.0.v20060605-1400</version>
+      <version>3.5.0.v20090603</version>
     </dependency>
-    -->
   </dependencies>
 
 </project>

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/DefaultPackage.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/DefaultPackage.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/DefaultPackage.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,4 @@
+
+public class DefaultPackage {
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/ant/taskdef.properties
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/ant/taskdef.properties	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/ant/taskdef.properties	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,7 @@
+bnd=aQute.bnd.ant.BndTask
+bndproject=aQute.bnd.ant.ProjectTask
+bndeclipse=aQute.bnd.ant.EclipseTask
+bndexpand=aQute.bnd.ant.ExpandPropertiesTask
+bndwrap=aQute.bnd.ant.WrapTask
+bnddeploy=aQute.bnd.ant.DeployTask
+bndprepare=aQute.bnd.ant.PrepareTask


Property changes on: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/ant/taskdef.properties
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/classpath/messages.properties
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/classpath/messages.properties	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/classpath/messages.properties	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,11 @@
+Browse=Browse...
+DirErr=The directory must be a subdirectory of the project {0}
+DirLabel=Directory:
+DirSelect=Select the directory for the Simple Dir Container
+ExtErr=Extensions are not valid.  Verify that the extensions are comma separated and do not include the preceding '.'
+ExtLabel=Extensions (comma separated, not including .): 
+InvalidContainer=Invalid container:
+PageDesc=A classpath container that collects files with configured extensions from a configured directory
+PageName=Simple Directory Container Wizard
+PageTitle=Simple Directory Container
+

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/changed.txt
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/changed.txt	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/changed.txt	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,9 @@
+0.0.325
+  - No longer flattening properties starting with - because for version policy, the 
+    context macro ${@} is not valid. I think this is true for more things. So they are now
+    unexpanded.
+  - toclasspath can now take a suffix parameter, possibly empty
+  - Include-Resource can now take optional parameters:
+      flatten:= (true|false). Default is false. Create recursive directories in the output or not.
+      recursive:= (true|false) Default is true. Will descend any directories or not
+      

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.properties
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.properties	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.properties	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,342 @@
+Add=Holders of DmtPermission with the Add action present can create new nodes in the DMT, that is they are authorized to execute the createInteriorNode() and createLeafNode() methods of the DmtSession.
+Delete=Holders of DmtPermission with the Delete action present can delete nodes from the DMT, that is they are authorized to execute the deleteNode() method of the DmtSession.
+Exec=Holders of DmtPermission with the Exec action present can execute nodes in the DMT, that is they are authorized to call the execute() method of the DmtSession.
+Get=Holders of DmtPermission with the Get action present can query DMT node value or properties, that is they are authorized to execute the isLeafNode(), getNodeAcl(), getEffectiveNodeAcl(), getMetaNode(), getNodeValue(), getChildNodeNames(), getNodeTitle(), getNodeVersion(), getNodeTimeStamp(), getNodeSize() and getNodeType() methods of the DmtSession.
+Replace=Holders of DmtPermission with the Replace action present can update DMT node value or properties, that is they are authorized to execute the setNodeAcl(), setNodeTitle(), setNodeValue(), setNodeType() and renameNode() methods of the DmtSession.
+get=The action string get.
+register=The action string register.
+export=The action string export.
+exportonly=The action string exportonly.
+import=The action string import.
+System Bundle=Location identifier of the OSGi system bundle , which is defined to be "System Bundle".
+system.bundle=Alias for the symbolic name of the OSGi system bundle .
+Bundle-Category=Manifest header identifying the bundle's category.
+Bundle-ClassPath=Manifest header identifying a list of directories and embedded JAR files, which are bundle resources used to extend the bundle's classpath.
+Bundle-Copyright=Manifest header identifying the bundle's copyright information.
+Bundle-Description=Manifest header containing a brief description of the bundle's functionality.
+Bundle-Name=Manifest header identifying the bundle's name.
+Bundle-NativeCode=Manifest header identifying a number of hardware environments and the native language code libraries that the bundle is carrying for each of these environments.
+Export-Package=Manifest header identifying the packages that the bundle offers to the Framework for export.
+Export-Service=Manifest header identifying the fully qualified class names of the services that the bundle may register (used for informational purposes only).
+Import-Package=Manifest header identifying the packages on which the bundle depends.
+DynamicImport-Package=Manifest header identifying the packages that the bundle may dynamically import during execution.
+Import-Service=Manifest header identifying the fully qualified class names of the services that the bundle requires (used for informational purposes only).
+Bundle-Vendor=Manifest header identifying the bundle's vendor.
+Bundle-Version=Manifest header identifying the bundle's version.
+Bundle-DocURL=Manifest header identifying the bundle's documentation URL, from which further information about the bundle may be obtained.
+Bundle-ContactAddress=Manifest header identifying the contact address where problems with the bundle may be reported; for example, an email address.
+Bundle-Activator=Manifest header attribute identifying the bundle's activator class.
+Bundle-UpdateLocation=Manifest header identifying the location from which a new bundle version is obtained during a bundle update operation.
+specification-version=Manifest header attribute identifying the version of a package specified in the Export-Package or Import-Package manifest header.
+processor=Manifest header attribute identifying the processor required to run native bundle code specified in the Bundle-NativeCode manifest header).
+osname=Manifest header attribute identifying the operating system required to run native bundle code specified in the Bundle-NativeCode manifest header).
+osversion=Manifest header attribute identifying the operating system version required to run native bundle code specified in the Bundle-NativeCode manifest header).
+language=Manifest header attribute identifying the language in which the native bundle code is written specified in the Bundle-NativeCode manifest header.
+Bundle-RequiredExecutionEnvironment=Manifest header identifying the required execution environment for the bundle.
+Bundle-SymbolicName=Manifest header identifying the bundle's symbolic name.
+singleton=Manifest header directive identifying whether a bundle is a singleton.
+fragment-attachment=Manifest header directive identifying if and when a fragment may attach to a host bundle.
+always=Manifest header directive value identifying a fragment attachment type of always.
+resolve-time=Manifest header directive value identifying a fragment attachment type of resolve-time.
+never=Manifest header directive value identifying a fragment attachment type of never.
+Bundle-Localization=Manifest header identifying the base name of the bundle's localization entries.
+OSGI-INF/l10n/bundle=Default value for the Bundle-Localization manifest header.
+Require-Bundle=Manifest header identifying the symbolic names of other bundles required by the bundle.
+bundle-version=Manifest header attribute identifying a range of versions for a bundle specified in the Require-Bundle or Fragment-Host manifest headers.
+Fragment-Host=Manifest header identifying the symbolic name of another bundle for which that the bundle is a fragment.
+selection-filter=Manifest header attribute is used for selection by filtering based upon system properties.
+Bundle-ManifestVersion=Manifest header identifying the bundle manifest version.
+version=Manifest header attribute identifying the version of a package specified in the Export-Package or Import-Package manifest header.
+bundle-symbolic-name=Manifest header attribute identifying the symbolic name of a bundle that exports a package specified in the Import-Package manifest header.
+resolution=Manifest header directive identifying the resolution type in the Import-Package or Require-Bundle manifest header.
+mandatory=Manifest header directive value identifying a mandatory resolution type.
+optional=Manifest header directive value identifying an optional resolution type.
+uses=Manifest header directive identifying a list of packages that an exported package uses.
+include=Manifest header directive identifying a list of classes to include in the exported package.
+exclude=Manifest header directive identifying a list of classes to exclude in the exported package..
+mandatory=Manifest header directive identifying names of matching attributes which must be specified by matching Import-Package statements in the Export-Package manifest header.
+visibility=Manifest header directive identifying the visibility of a required bundle in the Require-Bundle manifest header.
+private=Manifest header directive value identifying a private visibility type.
+reexport=Manifest header directive value identifying a reexport visibility type.
+extension=Manifest header directive identifying the type of the extension fragment.
+framework=Manifest header directive value identifying the type of extension fragment.
+bootclasspath=Manifest header directive value identifying the type of extension fragment.
+Bundle-ActivationPolicy=Manifest header identifying the bundle's activation policy.
+lazy=Bundle activation policy declaring the bundle must be activated when the first class load is made from the bundle.
+org.osgi.framework.version=Framework environment property identifying the Framework version.
+org.osgi.framework.vendor=Framework environment property identifying the Framework implementation vendor.
+org.osgi.framework.language=Framework environment property identifying the Framework implementation language (see ISO 639 for possible values).
+org.osgi.framework.os.name=Framework environment property identifying the Framework host-computer's operating system.
+org.osgi.framework.os.version=Framework environment property identifying the Framework host-computer's operating system version number.
+org.osgi.framework.processor=Framework environment property identifying the Framework host-computer's processor name.
+org.osgi.framework.executionenvironment=Framework environment property identifying execution environments provided by the Framework.
+org.osgi.framework.bootdelegation=Framework environment property identifying packages for which the Framework must delegate class loading to the parent class loader of the bundle.
+org.osgi.framework.system.packages=Framework environment property identifying packages which the system bundle must export.
+org.osgi.framework.system.packages.extra=Framework environment property identifying extra packages which the system bundle must export from the current execution environment.
+org.osgi.supports.framework.extension=Framework environment property identifying whether the Framework supports framework extension bundles.
+org.osgi.supports.bootclasspath.extension=Framework environment property identifying whether the Framework supports bootclasspath extension bundles.
+org.osgi.supports.framework.fragment=Framework environment property identifying whether the Framework supports fragment bundles.
+org.osgi.supports.framework.requirebundle=Framework environment property identifying whether the Framework supports the Require-Bundle manifest header.
+org.osgi.framework.security=Specifies the type of security manager the framework must use.
+osgi=Specifies that a security manager that supports all security aspects of the OSGi core specification including postponed conditions must be installed.
+org.osgi.framework.storage=Specified the persistent storage area used by the framework.
+org.osgi.framework.storage.clean=Specifies if and when the persistent storage area for the framework should be cleaned.
+onFirstInit=Specifies that the framework storage area must be cleaned before the framework is initialized for the first time.
+org.osgi.framework.library.extensions=Specifies a comma separated list of additional library file extensions that must be used when a bundle's class loader is searching for native libraries.
+org.osgi.framework.command.execpermission=Specifies an optional OS specific command to set file permissions on extracted native code.
+org.osgi.framework.trust.repositories=Specifies the trust repositories used by the framework.
+org.osgi.framework.windowsystem=Specifies the current windowing system.
+org.osgi.framework.startlevel.beginning=Specifies the beginning start level of the framework.
+org.osgi.framework.bundle.parent=Specifies the parent class loader type for all bundle class loaders.
+boot=Specifies to use of the boot class loader as the parent class loader for all bundle class loaders.
+app=Specifies to use the application class loader as the parent class loader for all bundle class loaders.
+ext=Specifies to use the extension class loader as the parent class loader for all bundle class loaders.
+framework=Specifies to use the framework class loader as the parent class loader for all bundle class loaders.
+objectClass=Service property identifying all of the class names under which a service was registered in the Framework.
+service.id=Service property identifying a service's registration number.
+service.pid=Service property identifying a service's persistent identifier.
+service.ranking=Service property identifying a service's ranking number.
+service.vendor=Service property identifying a service's vendor.
+service.description=Service property identifying a service's description.
+provide=The action string provide.
+require=The action string require.
+host=The action string host.
+fragment=The action string fragment.
+class=The action string class.
+execute=The action string execute.
+extensionLifecycle=The action string extensionLifecycle.
+lifecycle=The action string lifecycle.
+listener=The action string listener.
+metadata=The action string metadata.
+resolve=The action string resolve.
+resource=The action string resource.
+startlevel=The action string startlevel.
+context=The action string context.
+service.pid=The property key for the identifier of the application being scheduled.
+schedule.id=The property key for the schedule identifier.
+org.osgi.triggeringevent=The key for the startup argument used to pass the event object that triggered the schedule to launch the application instance.
+org/osgi/application/timer=The topic name for the virtual timer topic.
+year=The name of the year attribute of a virtual timer event.
+month=The name of the month attribute of a virtual timer event.
+day_of_month=The name of the day of month attribute of a virtual timer event.
+day_of_week=The name of the day of week attribute of a virtual timer event.
+hour_of_day=The name of the hour of day attribute of a virtual timer event.
+minute=The name of the minute attribute of a virtual timer event.
+service.pid=The property key for the unique identifier (PID) of the application instance.
+application.descriptor=The property key for the pid of the corresponding application descriptor.
+application.state=The property key for the state of this application instance.
+application.supports.exitvalue=The property key for the supports exit value property of this application instance.
+RUNNING=The application instance is running.
+STOPPING=The application instance is being stopped.
+application.name=The property key for the localized name of the application.
+application.icon=The property key for the localized icon of the application.
+service.pid=The property key for the unique identifier (PID) of the application.
+application.version=The property key for the version of the application.
+service.vendor=The property key for the name of the application vendor.
+application.visible=The property key for the visibility property of the application.
+application.launchable=The property key for the launchable property of the application.
+application.locked=The property key for the locked property of the application.
+application.description=The property key for the localized description of the application.
+application.documentation=The property key for the localized documentation of the application.
+application.copyright=The property key for the localized copyright notice of the application.
+application.license=The property key for the localized license of the application.
+application.container=The property key for the application container of the application.
+application.location=The property key for the location of the application.
+lifecycle=Allows the lifecycle management of the target applications.
+schedule=Allows scheduling of the target applications.
+lock=Allows setting/unsetting the locking state of the target applications.
+bundle.version=The version property defining the bundle on whose behalf a module context event has been issued.
+extender.bundle=The extender bundle property defining the extender bundle processing the module context for which an event has been issued.
+extender.bundle.id=The extender bundle id property defining the id of the extender bundle processing the module context for which an event has been issued.
+extender.bundle.symbolicName=The extender bundle symbolic name property defining the symbolic name of the extender bundle processing the module context for which an event has been issued.
+org/osgi/service/blueprint=Topic prefix for all events issued by the Blueprint Service
+org/osgi/service/blueprint/context/CREATING=Topic for Blueprint Service CREATING events
+org/osgi/service/blueprint/context/CREATED=Topic for Blueprint Service CREATED events
+org/osgi/service/blueprint/context/DESTROYING=Topic for Blueprint Service DESTROYING events
+org/osgi/service/blueprint/context/DESTROYED=Topic for Blueprint Service DESTROYED events
+org/osgi/service/blueprint/context/WAITING=Topic for Blueprint Service WAITING events
+org/osgi/service/blueprint/context/FAILURE=Topic for Blueprint Service FAILURE events
+singleton=
+prototype=
+bundle=
+cm.target=A service property to limit the Managed Service or Managed Service Factory configuration dictionaries a Configuration Plugin service receives.
+service.cmRanking=A service property to specify the order in which plugins are invoked.
+configure=The action string configure.
+service.factoryPid=Service property naming the Factory PID in the configuration dictionary.
+service.bundleLocation=Service property naming the location of the bundle that is associated with a a Configuration object.
+osgi.converter.classes=This property is a string, or array of strings, and defines the classes or interfaces that this converter recognizes.
+osgi.command.scope=The scope of commands provided by this service.
+osgi.command.function=A String, array, or list of method names that may be called for this command provider.
+Service-Component=Manifest header specifying the XML documents within a bundle that contain the bundle's Service Component descriptions.
+component.name=A component property for a component configuration that contains the name of the component as specified in the name attribute of the component element.
+component.id=A component property that contains the generated id for a component configuration.
+component.factory=A service registration property for a Component Factory that contains the value of the factory attribute.
+.target=The suffix for reference target properties.
+allow=This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "allow" if the conditions are all satisfied and at least one of the permissions is implied.
+deny=This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "deny" if the conditions are all satisfied and at least one of the permissions is implied.
+deploymentpackage.name=The name of the Deployment Package.
+deploymentpackage.readablename=The human readable name of the DP localized to the default locale.
+deploymentpackage.currentversion=The currently installed version of the Deployment Package.
+deploymentpackage.nextversion=The version of DP after the successful completion of the install operation (used in INSTALL event only).
+install=Constant String to the "install" action.
+list=Constant String to the "list" action.
+uninstall=Constant String to the "uninstall" action.
+uninstall_forced=Constant String to the "uninstall_forced" action.
+cancel=Constant String to the "cancel" action.
+metadata=Constant String to the "metadata" action.
+privatearea=Constant String to the "privatearea" action.
+-1=Return value from DriverSelector.select, if no Driver service should be attached to the Device service.
+DRIVER_ID=Property (named "DRIVER_ID") identifying a driver.
+DEVICE_CATEGORY=Property (named "DEVICE_CATEGORY") containing a human readable description of the device categories implemented by a device.
+DEVICE_SERIAL=Property (named "DEVICE_SERIAL") specifying a device's serial number.
+DEVICE_DESCRIPTION=Property (named "DEVICE_DESCRIPTION") containing a human readable string describing the actual hardware device.
+service.interface=Mandatory ServiceRegistration property which contains a collection of full qualified interface names offered by the advertised service endpoint.
+service.interface.version=Optional ServiceRegistration property which contains a collection of interface names with their associated version attributes separated by SEPARATOR e.g.
+osgi.remote.endpoint.interface=Optional ServiceRegistration property which contains a collection of interface names with their associated (non-Java) endpoint interface names separated by SEPARATOR e.g.: 'my.company.foo|MyWebService my.company.zoo|MyWebService'. This (non-Java) endpoint interface name is usually a communication protocol specific interface, for instance a web service interface name.
+service.properties=Optional ServiceRegistration property which contains a map of properties of the published service.
+osgi.remote.endpoint.location=Optional property of the published service identifying its location.
+osgi.remote.endpoint.id=Optional property of the published service uniquely identifying its endpoint.
+|=Separator constant for association of interface-specific values with the particular interface name.
+osgi.remote.discovery.product=Service Registration property for the name of the Discovery product.
+osgi.remote.discovery.product.version=Service Registration property for the version of the Discovery product.
+osgi.remote.discovery.vendor=Service Registration property for the Discovery product vendor name.
+osgi.remote.discovery.supported_protocols=Service Registration property that lists the discovery protocols used by this Discovery service.
+osgi.discovery.interest.interfaces=Optional ServiceRegistration property which contains service interfaces this tracker is interested in.
+osgi.discovery.interest.filters=Optional ServiceRegistration property which contains filters for services this tracker is interested in.
+osgi.remote.distribution.product=Service Registration property for the name of the Distribution Provider product.
+osgi.remote.distribution.product.version=Service Registration property for the version of the Distribution Provider product.
+osgi.remote.distribution.vendor=Service Registration property for the Distribution Provider product vendor name.
+osgi.remote.distribition.supported_intents=Service Registration property that lists the intents supported by this DistributionProvider.
+publish=The action string publish.
+subscribe=The action string subscribe.
+event.topics=Service registration property (named event.topics) specifying the Event topics of interest to a Event Handler service.
+event.filter=Service Registration property (named event.filter) specifying a filter to further select Event s of interest to a Event Handler service.
+bundle.signer=The Distinguished Names of the signers of the bundle relevant to the event.
+bundle.symbolicName=The Bundle Symbolic Name of the bundle relevant to the event.
+bundle.id=The Bundle id of the bundle relevant to the event.
+bundle=The Bundle object of the bundle relevant to the event.
+bundle.version=The version of the bundle relevant to the event.
+event=The forwarded event object.
+exception=An exception or error.
+exception.class=The name of the exception type.
+exception.message=The exception message.
+message=A human-readable message that is usually not localized.
+service=A service reference.
+service.id=A service's id.
+service.objectClass=A service's objectClass.
+service.pid=A service's persistent identity.
+timestamp=The time when the event occurred, as reported by System.currentTimeMillis().
+exception.class=This constant was released with an incorrectly spelled name.
+CompositeServiceFilter-Import=Manifest header (named "CompositeServiceFilter-Import") identifying the service filters that are used by a composite bundle to select services that will be registered into a child framework by its associated surrogate bundle.
+CompositeServiceFilter-Export=Manifest header (named "CompositeServiceFilter-Export") identifying the service filters that are used by a surrogate bundle to select services that will be registered into a parent framework by its associated composite bundle.
+org.osgi.service.http.authentication.remote.user=HttpServletRequest attribute specifying the name of the authenticated user.
+org.osgi.service.http.authentication.type=HttpServletRequest attribute specifying the scheme used in authentication.
+org.osgi.service.useradmin.authorization=HttpServletRequest attribute specifying the Authorization object obtained from the org.osgi.service.useradmin.UserAdmin service.
+io.scheme=Service property containing the scheme(s) for which this Connection Factory can create Connection objects.
+-1=Argument for getAttributeDefinitions(int).
+OSGI-INF/metatype=Location of meta type documents.
+read=Holders of MonitorPermission with the read action present are allowed to read the value of the StatusVariables specified in the permission's target field.
+reset=Holders of MonitorPermission with the reset action present are allowed to reset the value of the StatusVariables specified in the permission's target field.
+publish=Holders of MonitorPermission with the publish action present are Monitorable services that are allowed to publish the StatusVariables specified in the permission's target field.
+startjob=Holders of MonitorPermission with the startjob action present are allowed to initiate monitoring jobs involving the StatusVariables specified in the permission's target field.
+switchevents=Holders of MonitorPermission with the switchevents action present are allowed to switch event sending on or off for the value of the StatusVariables specified in the permission's target field.
+license=
+description=
+documentation=
+copyright=
+source=
+symbolicname=
+presentationname=
+id=
+version=
+url=
+size=
+provisioning.spid=The key to the provisioning information that uniquely identifies the Service Platform.
+provisioning.reference=The key to the provisioning information that contains the location of the provision data provider.
+provisioning.agent.config=The key to the provisioning information that contains the initial configuration information of the initial Management Agent.
+provisioning.update.count=The key to the provisioning information that contains the update count of the info data.
+provisioning.start.bundle=The key to the provisioning information that contains the location of the bundle to start with AllPermission.
+provisioning.rootx509=The key to the provisioning information that contains the root X509 certificate used to establish trust with operator when using HTTPS.
+provisioning.rsh.secret=The key to the provisioning information that contains the shared secret used in conjunction with the RSH protocol.
+text/plain;charset=utf-8=MIME type to be used in the InitialProvisioning-Entries header or stored in the extra field of a ZipEntry object for String data.
+application/octet-stream=MIME type to be used in the InitialProvisioning-Entries header or stored stored in the extra field of a ZipEntry object for byte[] data.
+application/vnd.osgi.bundle=MIME type to be used in the InitialProvisioning-Entries header or stored stored in the extra field of a ZipEntry object for an installable bundle file.
+application/x-osgi-bundle=Alternative MIME type to be used in the InitialProvisioning-Entries header or stored stored in the extra field of a ZipEntry object for an installable bundle file.
+text/x-osgi-bundle-url=MIME type to be stored in the extra field of a ZipEntry for a String that represents a URL for a bundle.
+InitialProvisioning-Entries=Name of the header that specifies the (MIME) type information for the ZIP file entries.
+ui1=Unsigned 1 Byte int.
+ui2=Unsigned 2 Byte int.
+ui4=Unsigned 4 Byte int.
+i1=1 Byte int.
+i2=2 Byte int.
+i4=4 Byte int.
+int=Integer number.
+r4=4 Byte float.
+r8=8 Byte float.
+number=Same as r8.
+fixed.14.4=Same as r8 but no more than 14 digits to the left of the decimal point and no more than 4 to the right.
+float=Floating-point number.
+char=Unicode string.
+string=Unicode string.
+date=A calendar date.
+dateTime=A specific instant of time.
+dateTime.tz=A specific instant of time.
+time=An instant of time that recurs every day.
+time.tz=An instant of time that recurs every day.
+boolean=True or false.
+bin.base64=MIME-style Base64 encoded binary BLOB.
+bin.hex=Hexadecimal digits representing octets.
+uri=Universal Resource Identifier.
+uuid=Universally Unique ID.
+UPnP.service.type=Property key for the optional service type uri.
+UPnP.service.id=Property key for the optional service id.
+upnp.filter=Key for a service property having a value that is an object of type org.osgi.framework.Filter and that is used to limit received events.
+UPnP=Constant for the value of the service property DEVICE_CATEGORY used for all UPnP devices.
+UPnP.export=The UPnP.export service property is a hint that marks a device to be picked up and exported by the UPnP Service.
+UPnP.device.UDN=Property key for the Unique Device Name (UDN) property.
+UPnP.device.UDN=Property key for the Unique Device ID property.
+UPnP.device.type=Property key for the UPnP Device Type property.
+UPnP.device.manufacturer=Mandatory property key for the device manufacturer's property.
+UPnP.device.modelName=Mandatory property key for the device model name.
+UPnP.device.friendlyName=Mandatory property key for a short user friendly version of the device name.
+UPnP.device.manufacturerURL=Optional property key for a URL to the device manufacturers Web site.
+UPnP.device.modelDescription=Optional (but recommended) property key for a String object with a long description of the device for the end user.
+UPnP.device.modelNumber=Optional (but recommended) property key for a String class typed property holding the model number of the device.
+UPnP.device.modelURL=Optional property key for a String typed property holding a string representing the URL to the Web site for this model.
+UPnP.device.serialNumber=Optional (but recommended) property key for a String typed property holding the serial number of the device.
+UPnP.device.UPC=Optional property key for a String typed property holding the Universal Product Code (UPC) of the device.
+UPnP.presentationURL=Optional (but recommended) property key for a String typed property holding a string representing the URL to a device representation Web page.
+UPnP.device.parentUDN=The property key that must be set for all embedded devices.
+UPnP.device.childrenUDN=The property key that must be set for all devices containing other embedded devices.
+url.handler.protocol=Service property naming the protocols serviced by a URLStreamHandlerService.
+url.content.mimetype=Service property naming the MIME types serviced by a java.net.ContentHandler.
+admin=The permission name "admin".
+changeProperty=The action string "changeProperty".
+changeCredential=The action string "changeCredential".
+getCredential=The action string "getCredential".
+user.anyone=The name of the predefined role, user.anyone, that all users and groups belong to.
+produce=The action string for the produce action.
+consume=The action string for the consume action.
+wireadmin.pid=Wire property key (named wireadmin.pid) specifying the persistent identity (PID) of this Wire object.
+wireadmin.producer.composite=A service registration property for a Producer service that is composite.
+wireadmin.consumer.composite=A service registration property for a Consumer service that is composite.
+wireadmin.producer.scope=Service registration property key (named wireadmin.producer.scope) specifying a list of names that may be used to define the scope of this Wire object.
+wireadmin.consumer.scope=Service registration property key (named wireadmin.consumer.scope) specifying a list of names that may be used to define the scope of this Wire object.
+wireadmin.producer.pid=Wire property key (named wireadmin.producer.pid) specifying the service.pid of the associated Producer service.
+wireadmin.consumer.pid=Wire property key (named wireadmin.consumer.pid) specifying the service.pid of the associated Consumer service.
+wireadmin.filter=Wire property key (named wireadmin.filter) specifying a filter used to control the delivery rate of data between the Producer and the Consumer service.
+wirevalue.current=Wire object's filter attribute (named wirevalue.current) representing the current value.
+wirevalue.previous=Wire object's filter attribute (named wirevalue.previous) representing the previous value.
+wirevalue.delta.absolute=Wire object's filter attribute (named wirevalue.delta.absolute) representing the absolute delta.
+wirevalue.delta.relative=Wire object's filter attribute (named wirevalue.delta.relative) representing the relative delta.
+wirevalue.elapsed=Wire object's filter attribute (named wirevalue.elapsed) representing the elapsed time, in ms, between this filter evaluation and the last update of the Consumer service.
+wireadmin.producer.filters=Service Registration property (named wireadmin.producer.filters).
+wireadmin.consumer.flavors=Service Registration property (named wireadmin.consumer.flavors) specifying the list of data types understood by this Consumer service.
+wireadmin.producer.flavors=Service Registration property (named wireadmin.producer.flavors) specifying the list of data types available from this Producer service.
+wireadmin.events=Service Registration property (named wireadmin.events) specifying the WireAdminEvent type of interest to a Wire Admin Listener service.
+javax.xml.parsers.SAXParserFactory=Filename containing the SAX Parser Factory Class name.
+javax.xml.parsers.DocumentBuilderFactory=Filename containing the DOM Parser Factory Class name.
+/META-INF/services/javax.xml.parsers.SAXParserFactory=Fully qualified path name of SAX Parser Factory Class Name file
+/META-INF/services/javax.xml.parsers.DocumentBuilderFactory=Fully qualified path name of DOM Parser Factory Class Name file
+parser.validating=Service property specifying if factory is configured to support validating parsers.
+parser.namespaceAware=Service property specifying if factory is configured to support namespace aware parsers.

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.xml
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.xml	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/help/syntax.xml	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,2 @@
+
+Bundle-Name\\s*(:|=)\\s*
\ No newline at end of file

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/main/bnd.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/main/bnd.java	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/main/bnd.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -23,7 +23,7 @@
  * 
  * TODO Add Javadoc comment for this type.
  * 
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
  */
 public class bnd extends Processor {
     PrintStream     out        = System.out;
@@ -89,6 +89,10 @@
                 cnt++;
                 doBuild(args, ++i);
                 break;
+            } else if ("extract".equals(args[i])) {
+                cnt++;
+                doExtract(args, ++i);
+                break;
             } else if ("patch".equals(args[i])) {
                 cnt++;
                 patch(args, ++i);
@@ -592,112 +596,117 @@
         else {
             if (options == 0)
                 options = VERIFY | MANIFEST | IMPEXP | USES;
+            doPrint(file, options);
+        }
+    }
 
-            Jar jar = new Jar(file.getName(), file);
-            try {
-                if ((options & VERIFY) != 0) {
-                    Verifier verifier = new Verifier(jar);
-                    verifier.setPedantic(isPedantic());
-                    verifier.verify();
-                    getInfo(verifier);
-                }
-                if ((options & MANIFEST) != 0) {
-                    Manifest manifest = jar.getManifest();
-                    if (manifest == null)
-                        warning("JAR file has no manifest " + string);
-                    else {
-                        out.println("[MANIFEST " + jar.getName() + "]");
-                        SortedSet<String> sorted = new TreeSet<String>();
-                        for (Object element : manifest.getMainAttributes()
-                                .keySet()) {
-                            sorted.add(element.toString());
-                        }
-                        for (String key : sorted) {
-                            Object value = manifest.getMainAttributes()
-                                    .getValue(key);
-                            format("%-40s %-40s\r\n",
-                                    new Object[] { key, value });
-                        }
-                    }
-                    out.println();
-                }
-                if ((options & IMPEXP) != 0) {
-                    out.println("[IMPEXP]");
-                    Manifest m = jar.getManifest();
-                    if (m != null) {
-                        Map<String, Map<String, String>> imports = parseHeader(m
-                                .getMainAttributes().getValue(
-                                        Analyzer.IMPORT_PACKAGE));
-                        Map<String, Map<String, String>> exports = parseHeader(m
-                                .getMainAttributes().getValue(
-                                        Analyzer.EXPORT_PACKAGE));
-                        imports.keySet().removeAll(exports.keySet());
-                        print("Import-Package",
-                                new TreeMap<String, Map<String, String>>(
-                                        imports));
-                        print("Export-Package",
-                                new TreeMap<String, Map<String, String>>(
-                                        exports));
-                    } else
-                        warning("File has no manifest");
-                }
+    private void doPrint(File file, int options )
+            throws ZipException, IOException, Exception {
 
-                if ((options & (USES | USEDBY)) != 0) {
-                    out.println();
-                    Analyzer analyzer = new Analyzer();
-                    analyzer.setPedantic(isPedantic());
-                    analyzer.setJar(jar);
-                    analyzer.analyze();
-                    if ((options & USES) != 0) {
-                        out.println("[USES]");
-                        printMapOfSets(new TreeMap<String, Set<String>>(
-                                analyzer.getUses()));
-                        out.println();
+        Jar jar = new Jar(file.getName(), file);
+        try {
+            if ((options & VERIFY) != 0) {
+                Verifier verifier = new Verifier(jar);
+                verifier.setPedantic(isPedantic());
+                verifier.verify();
+                getInfo(verifier);
+            }
+            if ((options & MANIFEST) != 0) {
+                Manifest manifest = jar.getManifest();
+                if (manifest == null)
+                    warning("JAR file has no manifest " + file);
+                else {
+                    out.println("[MANIFEST " + jar.getName() + "]");
+                    SortedSet<String> sorted = new TreeSet<String>();
+                    for (Object element : manifest.getMainAttributes()
+                            .keySet()) {
+                        sorted.add(element.toString());
                     }
-                    if ((options & USEDBY) != 0) {
-                        out.println("[USEDBY]");
-                        printMapOfSets(invertMapOfCollection(analyzer.getUses()));
+                    for (String key : sorted) {
+                        Object value = manifest.getMainAttributes()
+                                .getValue(key);
+                        format("%-40s %-40s\r\n",
+                                new Object[] { key, value });
                     }
                 }
+                out.println();
+            }
+            if ((options & IMPEXP) != 0) {
+                out.println("[IMPEXP]");
+                Manifest m = jar.getManifest();
+                if (m != null) {
+                    Map<String, Map<String, String>> imports = parseHeader(m
+                            .getMainAttributes().getValue(
+                                    Analyzer.IMPORT_PACKAGE));
+                    Map<String, Map<String, String>> exports = parseHeader(m
+                            .getMainAttributes().getValue(
+                                    Analyzer.EXPORT_PACKAGE));
+                    imports.keySet().removeAll(exports.keySet());
+                    print("Import-Package",
+                            new TreeMap<String, Map<String, String>>(
+                                    imports));
+                    print("Export-Package",
+                            new TreeMap<String, Map<String, String>>(
+                                    exports));
+                } else
+                    warning("File has no manifest");
+            }
 
-                if ((options & COMPONENT) != 0) {
-                    printComponents(out, jar);
+            if ((options & (USES | USEDBY)) != 0) {
+                out.println();
+                Analyzer analyzer = new Analyzer();
+                analyzer.setPedantic(isPedantic());
+                analyzer.setJar(jar);
+                analyzer.analyze();
+                if ((options & USES) != 0) {
+                    out.println("[USES]");
+                    printMapOfSets(new TreeMap<String, Set<String>>(
+                            analyzer.getUses()));
+                    out.println();
                 }
+                if ((options & USEDBY) != 0) {
+                    out.println("[USEDBY]");
+                    printMapOfSets(invertMapOfCollection(analyzer.getUses()));
+                }
+            }
 
-                if ((options & LIST) != 0) {
-                    out.println("[LIST]");
-                    for (Map.Entry<String, Map<String, Resource>> entry : jar
-                            .getDirectories().entrySet()) {
-                        String name = entry.getKey();
-                        Map<String, Resource> contents = entry.getValue();
-                        out.println(name);
-                        if (contents != null) {
-                            for (String element : contents.keySet()) {
-                                int n = element.lastIndexOf('/');
-                                if (n > 0)
-                                    element = element.substring(n + 1);
-                                out.print("  ");
-                                out.print(element);
-                                String path = element;
-                                if (name.length() != 0)
-                                    path = name + "/" + element;
-                                Resource r = contents.get(path);
-                                if (r != null) {
-                                    String extra = r.getExtra();
-                                    if (extra != null)
-                                        out.print(" extra='" + extra + "'");
-                                }
-                                out.println();
+            if ((options & COMPONENT) != 0) {
+                printComponents(out, jar);
+            }
+
+            if ((options & LIST) != 0) {
+                out.println("[LIST]");
+                for (Map.Entry<String, Map<String, Resource>> entry : jar
+                        .getDirectories().entrySet()) {
+                    String name = entry.getKey();
+                    Map<String, Resource> contents = entry.getValue();
+                    out.println(name);
+                    if (contents != null) {
+                        for (String element : contents.keySet()) {
+                            int n = element.lastIndexOf('/');
+                            if (n > 0)
+                                element = element.substring(n + 1);
+                            out.print("  ");
+                            out.print(element);
+                            String path = element;
+                            if (name.length() != 0)
+                                path = name + "/" + element;
+                            Resource r = contents.get(path);
+                            if (r != null) {
+                                String extra = r.getExtra();
+                                if (extra != null)
+                                    out.print(" extra='" + extra + "'");
                             }
-                        } else {
-                            out.println(name + " <no contents>");
+                            out.println();
                         }
+                    } else {
+                        out.println(name + " <no contents>");
                     }
-                    out.println();
                 }
-            } finally {
-                jar.close();
+                out.println();
             }
+        } finally {
+            jar.close();
         }
     }
 
@@ -901,8 +910,7 @@
             wrt.flush();
     }
 
-    private void copy(InputStreamReader rds, OutputStreamWriter wrt)
-            throws IOException {
+    private void copy(Reader rds, Writer wrt) throws IOException {
         char buffer[] = new char[1024];
         int size = rds.read(buffer);
         while (size > 0) {
@@ -1111,7 +1119,6 @@
         }
     }
 
-
     void doDiff(String args[], int first) throws IOException {
         File base = new File("");
         boolean strict = false;
@@ -1480,7 +1487,7 @@
         for (; i < args.length; i++) {
             if (args[i].startsWith("-reportdir")) {
                 reportDir = getFile(args[i]).getAbsoluteFile();
-                if ( reportDir.isFile() )
+                if (reportDir.isFile())
                     error("-reportdir must be a directory");
             } else if (args[i].startsWith("-title")) {
                 summary.addAttribute("title", args[++i]);
@@ -1564,7 +1571,8 @@
                     if (!target.isFile())
                         error("The target is not a proper JAR file: " + target);
                     else {
-                        report.addAttribute("title", f.getName().replace(".bnd", ""));
+                        report.addAttribute("title", f.getName().replace(
+                                ".bnd", ""));
                         report.addAttribute("id", target.getName());
                         errors = runtTests(report, reportDir, f, pl, target);
                     }
@@ -1578,11 +1586,11 @@
             ProjectLauncher pl, File target) throws Exception {
         int errors;
         String path = f.getName().replace(".bnd", "") + ".xml";
-        pl.setReport( getFile(reportDir , path));
+        pl.setReport(getFile(reportDir, path));
         report.addAttribute("report", path);
 
         errors = pl.run(target);
-        
+
         getInfo(pl);
         if (errors == 0) {
             trace("ok");
@@ -1594,4 +1602,51 @@
         }
         return errors;
     }
+
+    /**
+     * Extract a file from the JAR
+     */
+
+    public void doExtract(String args[], int i) throws Exception {
+        if (i >= args.length) {
+            error("No arguments for extract");
+            return;
+        }
+
+        File f = getFile(args[i++]);
+        if ( ! f.isFile() ) {
+            error("No JAR file to extract from: %s", f );
+            return;
+        }
+        
+        if ( i == args.length ) {
+            System.out.println("FILES:");
+            doPrint(f,LIST);
+            return;
+        }
+        Jar j = new Jar(f);
+        try {
+            Writer output = new OutputStreamWriter(out);
+            while (i < args.length) {
+                String path = args[i++];
+
+                Resource r = j.getResource(path);
+                if (r == null)
+                    error("No such resource: %s in %s", path, f);
+                else {
+                    InputStream in = r.openInputStream();
+                    try {
+                        InputStreamReader rds = new InputStreamReader(in);
+                        copy(rds, output);
+                        output.flush();
+                    } finally {
+                        in.close();
+                    }
+                }
+            }
+        } finally {
+            j.close();
+        }
+
+    }
 }

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/AnnotationReader.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/AnnotationReader.java	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/AnnotationReader.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -123,7 +123,7 @@
 
             Integer c = annotation.get("type");
             if (c != null) {
-                switch (c) {
+                switch (c.intValue()) {
                 case 0:
                     break;
                 case '?':

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/ComponentDef.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/ComponentDef.java	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/bnd/make/ComponentDef.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -3,7 +3,6 @@
 import java.io.*;
 import java.util.*;
 
-import aQute.lib.filter.*;
 import aQute.lib.osgi.*;
 import aQute.libg.version.*;
 

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Builder.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Builder.java	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Builder.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -18,7 +18,7 @@
  * 
  * Import-Package: package-decl ( ',' package-decl )*
  * 
- * @version $Revision: 1.20 $
+ * @version $Revision: 1.22 $
  */
 public class Builder extends Analyzer {
     private static final int    SPLIT_MERGE_LAST  = 1;
@@ -155,9 +155,9 @@
 
     private void doConditional(Jar dot) throws IOException {
         Map<String, Map<String, String>> conditionals = getHeader(CONDITIONAL_PACKAGE);
-        if ( conditionals.isEmpty() )
+        if (conditionals.isEmpty())
             return;
-        
+
         int size;
         do {
             size = dot.getDirectories().size();
@@ -605,7 +605,7 @@
                 }
             }
 
-            //destinationPath = checkDestinationPath(destinationPath);
+            // destinationPath = checkDestinationPath(destinationPath);
 
             if (!sourceFile.exists()) {
                 noSuchFile(jar, name, extra, source, destinationPath);
@@ -627,84 +627,50 @@
 
         InstructionFilter iFilter = null;
         if (filter != null) {
-            iFilter = new InstructionFilter(Instruction
-                    .getPattern(filter), recursive);
+            iFilter = new InstructionFilter(Instruction.getPattern(filter),
+                    recursive);
         } else {
             iFilter = new InstructionFilter(null, recursive);
         }
 
-        destinationPath = checkDestinationPath(destinationPath);
+        Map<String, File> files = newMap();
+        resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
 
-        File[] files = resolveFiles(sourceFile, iFilter, recursive);
-        for (File file : files) {
-            String dp;
-            if (flatten) {
-                if (destinationPath.length() == 0) {
-                    dp = file.getName();
-                } else {
-                    dp = destinationPath + "/"
-                            + file.getName();
-                }
-            } else {
-                dp = destinationPath
-                        + file.getParentFile().getAbsolutePath()
-                                .substring(
-                                        sourceFile
-                                                .getAbsolutePath()
-                                                .length());
-                if (dp.length() > 0) {
-                    dp += "/" + file.getName();
-                } else {
-                    dp = file.getName();
-                }
-            }
-            copy(jar, dp, file, preprocess, extra);
+        for (Map.Entry<String, File> entry : files.entrySet()) {            
+            copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
         }
         return destinationPath;
     }
 
-    private String checkDestinationPath(String destinationPath) {
 
-        // Some people insist on ending a directory with
-        // a slash ... it now also works if you do /=dir
-        if (destinationPath.endsWith("/"))
-            destinationPath = destinationPath.substring(0, destinationPath
-                    .length() - 1);
-        return destinationPath;
-    }
+    private void resolveFiles(File dir, FileFilter filter, boolean recursive,
+            String path, Map<String, File> files, boolean flatten) {
 
-    private File[] resolveFiles(File dir, FileFilter filter, boolean recursive) {
-        return resolveFiles(dir, filter, null, recursive);
-    }
-
-    private File[] resolveFiles(File dir, FileFilter filter, File[] files,
-            boolean recursive) {
-        if (files == null) {
-            files = EMPTY_FILE;
-        }
-
         if (Analyzer.doNotCopy.matcher(dir.getName()).matches()) {
-            return files;
+            return;
         }
 
         File[] fs = dir.listFiles(filter);
         for (File file : fs) {
             if (file.isDirectory()) {
                 if (recursive) {
-                    files = resolveFiles(file, filter, files, recursive);
+                    String nextPath;
+                    if ( flatten )
+                        nextPath = path;
+                    else
+                        nextPath = appendPath(
+                                path, file.getName());
+                    
+                    resolveFiles(file, filter, recursive, nextPath, files, flatten);
                 }
+                // Directories are ignored otherwise
             } else {
-                if (files.length == 0) {
-                    files = new File[] { file };
-                } else {
-                    File[] newFiles = new File[files.length + 1];
-                    System.arraycopy(files, 0, newFiles, 0, files.length);
-                    newFiles[newFiles.length - 1] = file;
-                    files = newFiles;
-                }
+                String p =appendPath(path, file.getName());
+                if ( files.containsKey(p))
+                    warning("Include-Resource overwrites entry %s from file %s", p, file);
+                files.put(p, file);
             }
         }
-        return files;
     }
 
     private void noSuchFile(Jar jar, String clause, Map<String, String> extra,
@@ -792,13 +758,10 @@
             return;
 
         if (from.isDirectory()) {
-            String next = path;
-            if (next.length() != 0 && ! next.endsWith("/"))
-                next += '/';
 
             File files[] = from.listFiles();
             for (int i = 0; i < files.length; i++) {
-                copy(jar, next + files[i].getName(), files[i], preprocess,
+                copy(jar, appendPath(path,files[i].getName()), files[i], preprocess,
                         extra);
             }
         } else {
@@ -810,7 +773,7 @@
                 String x = extra.get("extra");
                 if (x != null)
                     resource.setExtra(x);
-                if ( path.endsWith("/"))
+                if (path.endsWith("/"))
                     path = path + from.getName();
                 jar.putResource(path, resource);
             } else {
@@ -932,15 +895,34 @@
             }
             if (licenses != null) {
                 ps.println("  <licenses>");
+
                 Map<String, Map<String, String>> map = parseHeader(licenses);
                 for (Iterator<Map.Entry<String, Map<String, String>>> e = map
                         .entrySet().iterator(); e.hasNext();) {
+
+                    // Bundle-License:
+                    // http://www.opensource.org/licenses/apache2.0.php; \
+                    // description="${Bundle-Copyright}"; \
+                    // link=LICENSE
+                    //
+                    //  <license>
+                    //    <name>This material is licensed under the Apache
+                    // Software License, Version 2.0</name>
+                    //    <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+                    //    <distribution>repo</distribution>
+                    //    </license>
+
                     Map.Entry<String, Map<String, String>> entry = e.next();
                     ps.println("    <license>");
                     Map<String, String> values = entry.getValue();
-                    print(ps, values, "name", "name", (String) values
-                            .get("url"));
-                    print(ps, values, "url", "url", null);
+                    String url = entry.getKey();
+
+                    if (values.containsKey("description"))
+                        print(ps, values, "description", "name", url);
+                    else
+                        print(ps, values, "name", "name", url);
+
+                    print(ps, values, "url", "url", url);
                     print(ps, values, "distribution", "distribution", "repo");
                     ps.println("    </license>");
                 }

Modified: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Processor.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Processor.java	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/Processor.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -1102,4 +1102,43 @@
         return missingCommand != null && missingCommand.contains(name);
     }
 
+    /**
+     * Append two strings to for a path in a ZIP or JAR file. It is guaranteed
+     * to return a string that does not start, nor ends with a '/', while it is
+     * properly separated with slashes. Double slashes are properly removed.
+     * 
+     * <pre>
+     *  "/" + "abc/def/" becomes "abc/def"
+     *  
+     * @param prefix
+     * @param suffix
+     * @return
+     */
+    public static String appendPath(String... parts) {
+        StringBuilder sb = new StringBuilder();
+        boolean lastSlash = true;
+        for (String part : parts) {
+            for (int i = 0; i < part.length(); i++) {
+                char c = part.charAt(i);
+                if (c == '/') {
+                    if (!lastSlash)
+                        sb.append('/');
+                    lastSlash = true;
+                } else {
+                    sb.append(c);
+                    lastSlash = false;
+                }
+            }
+            if ( !lastSlash & sb.length()>0) {
+                sb.append('/');
+                lastSlash=true;
+            }
+        }
+        if (lastSlash && sb.length() > 0)
+            sb.deleteCharAt(sb.length() - 1);
+
+        return sb.toString();
+    }
+
+
 }

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/bnd.info
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/bnd.info	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/osgi/bnd.info	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,2 @@
+modified=${currenttime}
+version=${Bundle-Version}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/JPAComponent.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/JPAComponent.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/JPAComponent.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,30 @@
+package aQute.lib.spring;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+import javax.xml.transform.*;
+import javax.xml.transform.stream.*;
+
+import aQute.bnd.service.*;
+import aQute.lib.osgi.*;
+
+/**
+ * This component is called when we find a resource in the META-INF/*.xml
+ * pattern. We parse the resource and and the imports to the builder.
+ * 
+ * Parsing is done with XSLT (first time I see the use of having XML for the
+ * Spring configuration files!).
+ * 
+ * @author aqute
+ * 
+ */
+public class JPAComponent extends XMLTypeProcessor {
+    
+    protected List<XMLType> getTypes(Analyzer analyzer) throws Exception {
+        List<XMLType> types = new ArrayList<XMLType>();        
+        process(types,"jpa.xsl", "META-INF", "persistence.xml");
+        return types;
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringComponent.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringComponent.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringComponent.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,97 @@
+package aQute.lib.spring;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+import javax.xml.transform.*;
+import javax.xml.transform.stream.*;
+
+import aQute.bnd.service.*;
+import aQute.lib.osgi.*;
+
+/**
+ * This component is called when we find a resource in the META-INF/*.xml
+ * pattern. We parse the resource and and the imports to the builder.
+ * 
+ * Parsing is done with XSLT (first time I see the use of having XML for the
+ * Spring configuration files!).
+ * 
+ * @author aqute
+ * 
+ */
+public class SpringComponent implements AnalyzerPlugin {
+	static Transformer transformer;
+	static Pattern SPRING_SOURCE = Pattern.compile("META-INF/spring/.*\\.xml");
+	static Pattern QN = Pattern.compile("[_A-Za-z$][_A-Za-z0-9$]*(\\.[_A-Za-z$][_A-Za-z0-9$]*)*");
+
+	public static Set<CharSequence> analyze(InputStream in) throws Exception {
+		if (transformer == null) {
+			TransformerFactory tf = TransformerFactory.newInstance();
+			Source source = new StreamSource(SpringComponent.class
+					.getResourceAsStream("extract.xsl"));
+			transformer = tf.newTransformer(source);
+		}
+
+		Set<CharSequence> refers = new HashSet<CharSequence>();
+
+		ByteArrayOutputStream bout = new ByteArrayOutputStream();
+		Result r = new StreamResult(bout);
+		Source s = new StreamSource(in);
+		transformer.transform(s, r);
+
+		ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+		bout.close();
+
+		BufferedReader br = new BufferedReader(new InputStreamReader(bin));
+
+		String line = br.readLine();
+		while (line != null) {
+			line = line.trim();
+			if (line.length() > 0) {
+				String parts[] = line.split("\\s*,\\s*");
+				for (int i = 0; i < parts.length; i++) {
+					int n = parts[i].lastIndexOf('.');
+					if (n > 0) {
+						refers.add(parts[i].subSequence(0, n));
+					}
+				}
+			}
+			line = br.readLine();
+		}
+		br.close();
+		return refers;
+	}
+
+	@SuppressWarnings("unchecked")
+    public boolean analyzeJar(Analyzer analyzer) throws Exception {
+	    Jar jar = analyzer.getJar();
+		Map dir = (Map) jar.getDirectories().get("META-INF/spring");
+		if ( dir == null || dir.isEmpty())
+			return false;
+		
+		for (Iterator i = dir.entrySet().iterator(); i.hasNext();) {
+			Map.Entry entry = (Map.Entry) i.next();
+			String path = (String) entry.getKey();
+			Resource resource = (Resource) entry.getValue();
+			if (SPRING_SOURCE.matcher(path).matches()) {
+				try {
+				InputStream in = resource.openInputStream();
+				Set set = analyze(in);
+				in.close();
+				for (Iterator r = set.iterator(); r.hasNext();) {
+					String pack = (String) r.next();
+					if ( !QN.matcher(pack).matches())
+					    analyzer.warning("Package does not seem a package in spring resource ("+path+"): " + pack );
+					if (!analyzer.getReferred().containsKey(pack))
+						analyzer.getReferred().put(pack, new LinkedHashMap());
+				}
+				} catch( Exception e ) {
+					analyzer.error("Unexpected exception in processing spring resources("+path+"): " + e );
+				}
+			}
+		}
+		return false;
+	}
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringXMLType.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringXMLType.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/SpringXMLType.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,33 @@
+package aQute.lib.spring;
+
+import java.util.*;
+
+import aQute.lib.osgi.*;
+
+/**
+ * This component is called when we find a resource in the META-INF/*.xml
+ * pattern. We parse the resource and and the imports to the builder.
+ * 
+ * Parsing is done with XSLT (first time I see the use of having XML for the
+ * Spring configuration files!).
+ * 
+ * @author aqute
+ * 
+ */
+public class SpringXMLType extends XMLTypeProcessor {
+
+    protected List<XMLType> getTypes(Analyzer analyzer) throws Exception {
+        List<XMLType> types = new ArrayList<XMLType>();
+        
+        String header = analyzer.getProperty("Bundle-Blueprint", "META-INF/blueprint");
+        process(types,"extract.xsl", header, ".*\\.xml");
+        header = analyzer.getProperty("Spring-Context", "META-INF/spring");
+        process(types,"extract.xsl", header, ".*\\.xml"); 
+        
+        return types;
+    }
+
+ 
+
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLType.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLType.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLType.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,108 @@
+package aQute.lib.spring;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.regex.*;
+
+import javax.xml.transform.*;
+import javax.xml.transform.stream.*;
+
+import aQute.lib.osgi.*;
+
+public class XMLType {
+    
+    Transformer    transformer;
+    Pattern        paths;
+    String          root;
+    
+    
+    static Pattern QN = Pattern
+                              .compile("[_A-Za-z$][_A-Za-z0-9$]*(\\.[_A-Za-z$][_A-Za-z0-9$]*)*");
+
+    public XMLType(URL source, String root, String paths ) throws Exception {
+        transformer = getTransformer(source);
+        this.paths = Pattern.compile(paths);
+        this.root = root;
+    }
+    
+    public Set<String> analyze(InputStream in) throws Exception {
+        Set<String> refers = new HashSet<String>();
+
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        Result r = new StreamResult(bout);
+        Source s = new StreamSource(in);
+        transformer.transform(s, r);
+
+        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+        bout.close();
+
+        BufferedReader br = new BufferedReader(new InputStreamReader(bin));
+
+        String line = br.readLine();
+        while (line != null) {
+            line = line.trim();
+            if (line.length() > 0) {
+                String parts[] = line.split("\\s*,\\s*");
+                for (int i = 0; i < parts.length; i++) {
+                    int n = parts[i].lastIndexOf('.');
+                    if (n > 0) {
+                        refers.add(parts[i].subSequence(0, n).toString());
+                    }
+                }
+            }
+            line = br.readLine();
+        }
+        br.close();
+        return refers;
+    }
+
+    public boolean analyzeJar(Analyzer analyzer) throws Exception {
+        Jar jar = analyzer.getJar();
+        Map<String,Resource> dir = jar.getDirectories().get(root);
+        if (dir == null || dir.isEmpty()) {
+            Resource resource  = jar.getResource(root);
+            if ( resource != null )
+                process(analyzer, root, resource);
+            return false;
+        }
+
+        for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
+            Map.Entry<String,Resource> entry = i.next();
+            String path = entry.getKey();
+            Resource resource = entry.getValue();
+            if (paths.matcher(path).matches()) {
+                process(analyzer, path, resource);
+            }
+        }
+        return false;
+    }
+
+    private void process(Analyzer analyzer, String path, Resource resource) {
+        try {
+            InputStream in = resource.openInputStream();
+            Set<String> set = analyze(in);
+            in.close();
+            for (Iterator<String> r = set.iterator(); r.hasNext();) {
+                String pack = r.next();
+                if (!QN.matcher(pack).matches())
+                    analyzer
+                            .warning("Package does not seem a package in spring resource ("
+                                    + path + "): " + pack);
+                if (!analyzer.getReferred().containsKey(pack))
+                    analyzer.getReferred().put(pack,
+                            new LinkedHashMap<String,String>());
+            }
+        } catch (Exception e) {
+            analyzer
+                    .error("Unexpected exception in processing spring resources("
+                            + path + "): " + e);
+        }
+    }
+
+    protected Transformer getTransformer(java.net.URL url) throws Exception {
+        TransformerFactory tf = TransformerFactory.newInstance();
+        Source source = new StreamSource(url.openStream());
+        return tf.newTransformer(source);
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLTypeProcessor.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLTypeProcessor.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/XMLTypeProcessor.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,33 @@
+package aQute.lib.spring;
+
+import java.util.*;
+
+import aQute.bnd.service.*;
+import aQute.lib.osgi.*;
+
+public class XMLTypeProcessor implements AnalyzerPlugin {
+    
+    public boolean analyzeJar(Analyzer analyzer) throws Exception {
+        List<XMLType> types = getTypes(analyzer);
+        for ( XMLType type : types ) {
+            type.analyzeJar(analyzer);
+        }
+        return false;
+    }
+    
+    protected List<XMLType> getTypes(Analyzer analyzer) throws Exception {
+        return new ArrayList<XMLType>();
+    }
+
+
+    protected void process(List<XMLType> types, String resource, String paths,
+            String pattern) throws Exception {
+        
+        Map<String,Map<String,String>> map = Processor.parseHeader(paths,null);
+        for ( String path : map.keySet() ) {
+            types.add( new XMLType( getClass().getResource(resource), path, pattern ));
+        }
+    }
+
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/extract.xsl
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/extract.xsl	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/extract.xsl	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:osgi-compendium="http://www.springframework.org/schema/osgi-compendium" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:tool="http://www.springframework.org/schema/tool" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:webflow-config="http://www.springframework.org/schema/webflow-config">
+	<xsl:output method="text" />
+
+	<xsl:template match="/">
+
+		<!-- Match all attributes that holds a class or a comma delimited 
+		     list of classes and print them -->
+
+		<xsl:for-each select="
+				//beans:bean/@class 
+			|	//beans:*/@value-type 
+ 			|	//aop:*/@implement-interface
+			|	//aop:*/@default-impl
+			|	//context:load-time-weaver/@weaver-class
+			|	//jee:jndi-lookup/@expected-type
+			|	//jee:jndi-lookup/@proxy-interface
+			| 	//jee:remote-slsb/@ejbType
+			|	//jee:*/@business-interface
+			|	//lang:*/@script-interfaces
+			|	//osgi:*/@interface
+			|	//util:list/@list-class
+			|	//util:set/@set-class
+			|	//util:map/@map-class
+			|	//webflow-config:*/@class
+		">
+			<xsl:value-of select="." />
+			<xsl:text>
+			</xsl:text>
+		</xsl:for-each>
+
+		<!-- This seems some magic to get extra imports? -->
+
+		<xsl:for-each select="//beans:bean[@class='org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean'
+				or @class='org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean']">
+			<xsl:for-each select="beans:property[@name='interfaces']">
+				<xsl:value-of select="@value" />
+				<xsl:text>
+				</xsl:text>
+			</xsl:for-each>
+		</xsl:for-each>
+
+	</xsl:template>
+
+
+</xsl:stylesheet>
+

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/hibernate.xsl
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/hibernate.xsl	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/hibernate.xsl	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:osgi-compendium="http://www.springframework.org/schema/osgi-compendium" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:tool="http://www.springframework.org/schema/tool" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:webflow-config="http://www.springframework.org/schema/webflow-config">
+	<xsl:output method="text" />
+
+	<xsl:template match="/">
+
+		<!-- Match all attributes that holds a class or a comma delimited 
+		     list of classes and print them -->
+
+		<xsl:for-each select="//provider|//class">
+			<xsl:value-of select="." />
+			<xsl:text>
+			</xsl:text>
+		</xsl:for-each>
+	</xsl:template>
+
+
+</xsl:stylesheet>
+

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/jpa.xsl
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/jpa.xsl	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/aQute/lib/spring/jpa.xsl	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:osgi-compendium="http://www.springframework.org/schema/osgi-compendium" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:tool="http://www.springframework.org/schema/tool" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:webflow-config="http://www.springframework.org/schema/webflow-config">
+	<xsl:output method="text" />
+
+	<xsl:template match="/">
+
+		<!-- Match all attributes that holds a class or a comma delimited 
+		     list of classes and print them -->
+
+		<xsl:for-each select="
+     	//class/@name
+    | 	//composite-id/@class
+    | 	//component/@class
+    | 	//discriminator/@type
+    | 	//dynamic-component/@class
+    | 	//generator/@class
+    | 	//id/@type
+    | 	//import/@class
+    | 	//joined-subclass/@name
+    | 	//many-to-many/@class
+    | 	//many-to-one/@class
+    | 	//one-to-many/@class
+    | 	//one-to-one/@class
+    | 	//property/@type
+    | 	//subclass/@name
+    | 	//union-subclass/@name
+    | 	//version/@type
+ 		">
+			<xsl:value-of select="." />
+			<xsl:text>
+			</xsl:text>
+		</xsl:for-each>
+	</xsl:template>
+
+
+</xsl:stylesheet>
+

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/popup/Refresh.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/popup/Refresh.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/biz/aqute/bnd/eclipse/popup/Refresh.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,42 @@
+package biz.aqute.bnd.eclipse.popup;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class Refresh implements IObjectActionDelegate {
+
+	/**
+	 * Constructor for Action1.
+	 */
+	public Refresh() {
+		super();
+	}
+
+	/**
+	 * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+	 */
+	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+	}
+
+	/**
+	 * @see IActionDelegate#run(IAction)
+	 */
+	public void run(IAction action) {
+		Shell shell = new Shell();
+		MessageDialog.openInformation(
+			shell,
+			"aQute Bundle Tool",
+			"New Action was executed.");
+	}
+
+	/**
+	 * @see IActionDelegate#selectionChanged(IAction, ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+	}
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/AWTLayout.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/AWTLayout.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/AWTLayout.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,66 @@
+/*
+ -----------------------------------------------------------------------------
+  (c) Copyright IBM Corp. 2003  All rights reserved.
+
+ The sample program(s) is/are owned by International Business Machines
+ Corporation or one of its subsidiaries ("IBM") and is/are copyrighted and
+ licensed, not sold.
+
+ You may copy, modify, and distribute this/these sample program(s) in any form
+ without payment to IBM, for any purpose including developing, using, marketing
+ or distributing programs that include or are derivative works of the sample
+ program(s).
+
+ The sample program(s) is/are provided to you on an "AS IS" basis, without
+ warranty of any kind.  IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER
+ EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Some jurisdictions do
+ not allow for the exclusion or limitation of implied warranties, so the above
+ limitations or exclusions may not apply to you.  IBM shall not be liable for
+ any damages you suffer as a result of using, modifying or distributing the
+ sample program(s) or its/their derivatives.
+
+ Each copy of any portion of this/these sample program(s) or any derivative
+ work, must include the above copyright notice and disclaimer of warranty.
+
+ -----------------------------------------------------------------------------
+*/
+
+package swing2swt.layout;
+
+import java.awt.Dimension;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Layout;
+
+/**
+ * Superclass for all the AWT layouts ported to SWT.
+ * @author Yannick Saillet
+ */
+public abstract class AWTLayout extends Layout {
+
+   /** 
+   * Key under which an eventual preferred size (set with setPreferredSize)
+   * is stored as a user data in the SWT control.
+   */
+  public final static String KEY_PREFERRED_SIZE = "preferredSize";
+
+  /**
+   * Gets the preferred size of a component.
+   * If a preferred size has been set with setPreferredSize, returns it, 
+   * otherwise returns the component computed preferred size.
+   */
+  protected Point getPreferredSize(
+    Control control,
+    int wHint,
+    int hHint,
+    boolean changed) {
+    // check if a preferred size was set on the control with 
+    // SWTComponent.setPreferredSize(Dimension)
+    Dimension d = (Dimension)control.getData(KEY_PREFERRED_SIZE);
+    if (d != null)
+      return new Point(d.width, d.height);
+    return control.computeSize(wHint, hHint, changed);
+  }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/GridLayout.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/GridLayout.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/bnd/src/main/java/swing2swt/layout/GridLayout.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,172 @@
+/*
+ -----------------------------------------------------------------------------
+  (c) Copyright IBM Corp. 2003  All rights reserved.
+
+ The sample program(s) is/are owned by International Business Machines
+ Corporation or one of its subsidiaries ("IBM") and is/are copyrighted and
+ licensed, not sold.
+
+ You may copy, modify, and distribute this/these sample program(s) in any form
+ without payment to IBM, for any purpose including developing, using, marketing
+ or distributing programs that include or are derivative works of the sample
+ program(s).
+
+ The sample program(s) is/are provided to you on an "AS IS" basis, without
+ warranty of any kind.  IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER
+ EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  Some jurisdictions do
+ not allow for the exclusion or limitation of implied warranties, so the above
+ limitations or exclusions may not apply to you.  IBM shall not be liable for
+ any damages you suffer as a result of using, modifying or distributing the
+ sample program(s) or its/their derivatives.
+
+ Each copy of any portion of this/these sample program(s) or any derivative
+ work, must include the above copyright notice and disclaimer of warranty.
+
+ -----------------------------------------------------------------------------
+*/
+
+package swing2swt.layout;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.*;
+
+/**
+ * Port of AWT GridLayout to SWT.
+ * @author Yannick Saillet
+ */
+public class GridLayout extends AWTLayout {
+  private int rows, columns, hgap, vgap;
+
+  public GridLayout() {
+    this(1, 0);
+  }
+
+  public GridLayout(int rows, int columns) {
+    this(rows, columns, 0, 0);
+  }
+
+  public GridLayout(int rows, int columns, int hgap, int vgap) {
+    if (rows == 0 && columns == 0)
+      throw new IllegalArgumentException("rows and cols cannot both be zero");
+
+    if (rows > 0 && columns > 0)
+      columns = 0;
+
+    this.rows = rows;
+    this.columns = columns;
+    this.hgap = hgap;
+    this.vgap = vgap;
+  }
+
+  public int getColumns() {
+    return columns;
+  }
+
+  public int getHgap() {
+    return hgap;
+  }
+
+  public int getRows() {
+    return rows;
+  }
+
+  public int getVgap() {
+    return vgap;
+  }
+
+  public void setColumns(int cols) {
+    if (rows == 0 && columns == 0)
+      throw new IllegalArgumentException("rows and cols cannot both be zero");
+
+    this.columns = cols;
+  }
+
+  public void setHgap(int hgap) {
+    this.hgap = hgap;
+  }
+
+  public void setRows(int rows) {
+    if (rows == 0 && columns == 0)
+      throw new IllegalArgumentException("rows and cols cannot both be zero");
+
+    this.rows = rows;
+  }
+
+  public void setVgap(int vgap) {
+    this.vgap = vgap;
+  }
+
+  //----------
+
+  protected Point computeSize(
+    Composite composite,
+    int wHint,
+    int hHint,
+    boolean flushCache) {
+    Control[] children = composite.getChildren();
+    int nbOfVisibleChildren = 0;
+    for (int i = 0; i < children.length; i++) {
+      //if (children[i].isVisible())
+        nbOfVisibleChildren++;
+    }
+
+    if (nbOfVisibleChildren == 0)
+      return new Point(0, 0);
+    int r = rows;
+    int c = columns;
+    if (r == 0)
+      r = nbOfVisibleChildren / c + ((nbOfVisibleChildren % c) == 0 ? 0 : 1);
+    else if (c == 0)
+      c = nbOfVisibleChildren / r + ((nbOfVisibleChildren % r) == 0 ? 0 : 1);
+    int width = 0;
+    int height = 0;
+    for (int i = 0; i < children.length; i++) {
+      //if (!children[i].isVisible())
+        //continue;
+      Point size =
+        getPreferredSize(children[i], SWT.DEFAULT, SWT.DEFAULT, flushCache);
+      if (size.x > width)
+        width = size.x;
+      if (size.y > height)
+        height = size.y;
+    }
+    return new Point(c * width + (c - 1) * hgap, r * height + (r - 1) * vgap);
+  }
+
+  protected void layout(Composite composite, boolean flushCache) {
+    Rectangle clientArea = composite.getClientArea();
+    Control[] children = composite.getChildren();
+    int nbOfVisibleChildren = 0;
+    for (int i = 0; i < children.length; i++) {
+      //if (children[i].isVisible())
+        nbOfVisibleChildren++;
+    }
+    if (nbOfVisibleChildren == 0)
+      return ;
+
+    int r = rows;
+    int c = columns;
+    if (r == 0)
+      r = nbOfVisibleChildren / c + ((nbOfVisibleChildren % c) == 0 ? 0 : 1);
+    else if (c == 0)
+      c = nbOfVisibleChildren / r + ((nbOfVisibleChildren % r) == 0 ? 0 : 1);
+    int width = (clientArea.width - (c - 1) * hgap) / c;
+    int height = (clientArea.height - (r - 1) * vgap) / r;
+
+    int x = clientArea.x;
+    int y = clientArea.y;
+    for (int i = 0; i < children.length; i++) {
+      //if (!children[i].isVisible())
+        //continue;
+      children[i].setBounds(x, y, width, height);
+      if (((i + 1) % c) == 0) // if new line
+        {
+        x = clientArea.x;
+        y += height + vgap;
+      } else
+        x += width + hgap;
+    }
+  }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/.classpath
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/.classpath	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/.classpath	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: projects/jboss-osgi/projects/aQute/trunk/libg/.project
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/.project	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/.project	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>libg</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.eclipse.jdt.core.prefs	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,5 @@
+#Tue Sep 29 07:53:53 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/.settings/org.maven.ide.eclipse.prefs	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,9 @@
+#Tue Sep 29 07:53:52 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: projects/jboss-osgi/projects/aQute/trunk/libg/pom.xml
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/pom.xml	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+  <!-- ====================================================================== -->
+  <!--                                                                        -->
+  <!--  JBoss, the OpenSource J2EE webOS                                      -->
+  <!--                                                                        -->
+  <!--  Distributable under LGPL license.                                     -->
+  <!--  See terms of license at http://www.gnu.org.                           -->
+  <!--                                                                        -->
+  <!-- ====================================================================== -->
+
+  <!-- $Id: pom.xml 93592 2009-09-16 09:00:08Z thomas.diesler at jboss.com $
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>aQute - Libg</name>
+
+  <groupId>biz.aQute</groupId>
+  <artifactId>libg</artifactId>
+  <packaging>jar</packaging>
+
+  <!-- Parent -->
+  <parent>
+    <groupId>biz.aQute</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.0.356-SNAPSHOT</version>
+  </parent>
+
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/base64/Base64.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/base64/Base64.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/base64/Base64.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,135 @@
+package aQute.lib.base64;
+
+import java.io.*;
+
+/*
+ * Base 64 converter.
+ * 
+ * TODO Implement string to byte[]
+ */
+public class Base64 {
+	byte[]				data;
+
+	static final String	alphabet	= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+	static byte[]		values		= new byte[128];
+
+	static {
+		for (int i = 0; i < values.length; i++) {
+			values[i] = -1;
+		}
+		// Create reverse index
+		for (int i = 0; i < alphabet.length(); i++) {
+			char c = alphabet.charAt(i);
+			values[c] = (byte) i;
+		}
+	}
+
+	public Base64(byte data[]) {
+		this.data = data;
+	}
+
+	public final static byte[] decodeBase64(String string) {
+		string = string.trim();
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+		int register = 0;
+		int i = 0;
+		int pads = 0;
+
+		byte test[] = new byte[3];
+
+		while (i < string.length()) {
+			char c = string.charAt(i);
+			if (c > 0x7F)
+				throw new IllegalArgumentException(
+						"Invalid base64 character in " + string
+								+ ", character value > 128 ");
+			
+			int v = 0;
+			if ( c == '=' ) {
+				pads++;
+			} else {
+				v = values[c];
+				if ( v < 0 )
+					throw new IllegalArgumentException(
+							"Invalid base64 character in " + string + ", " + c );
+			}					
+			register <<= 6;
+			register |= v;
+			test[2] = (byte) (register & 0xFF);
+			test[1] = (byte) ((register >> 8) & 0xFF);
+			test[0] = (byte) ((register >> 16) & 0xFF);
+
+			i++;
+
+			if ((i % 4) == 0) {
+				flush(out, register, pads);
+				register = 0;
+				pads = 0;
+			}
+		}
+		return out.toByteArray();
+	}
+
+	static private void flush(ByteArrayOutputStream out, int register, int pads) {
+		switch (pads) {
+		case 0:
+			out.write(0xFF & (register >> 16));
+			out.write(0xFF & (register >> 8));
+			out.write(0xFF & (register >> 0));
+			break;
+			
+		case 1:
+			out.write(0xFF & (register >> 16));
+			out.write(0xFF & (register >> 8));
+			break;
+			
+		case 2:
+			out.write(0xFF & (register >> 16));
+		}
+	}
+
+	public Base64(String s) {
+		data = decodeBase64(s);
+	}
+
+	public String toString() {
+		return encodeBase64(data);
+	}
+
+	public static String encodeBase64(byte data[]) {
+		StringBuffer sb = new StringBuffer();
+		int buf = 0;
+		int bits = 0;
+		int n = 0;
+
+		while (true) {
+			if (bits >= 6) {
+				bits -= 6;
+				int v = 0x3F & (buf >> bits);
+				sb.append(alphabet.charAt(v));
+			} else {
+				if (n >= data.length)
+					break;
+
+				buf <<= 8;
+				buf |= 0xFF & data[n++];
+				bits += 8;
+			}
+		}
+		if (bits != 0) // must be less than 7
+			sb.append(alphabet.charAt(0x3F & (buf << (6 - bits))));
+
+		int mod = 4 - (sb.length() % 4);
+		if (mod != 4) {
+			for (int i = 0; i < mod; i++)
+				sb.append('=');
+		}
+		return sb.toString();
+	}
+
+	public Object toData() {
+		return data;
+	}
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/filter/Filter.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/filter/Filter.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/filter/Filter.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,353 @@
+/**
+ * Copyright (c) 2000 Gatespace AB. All Rights Reserved.
+ *
+ * Gatespace grants Open Services Gateway Initiative (OSGi) an irrevocable,
+ * perpetual, non-exclusive, worldwide, paid-up right and license to
+ * reproduce, display, perform, prepare and have prepared derivative works
+ * based upon and distribute and sublicense this material and derivative
+ * works thereof as set out in the OSGi MEMBER AGREEMENT as of January 24
+ * 2000, for use in accordance with Section 2.2 of the BY-LAWS of the
+ * OSGi MEMBER AGREEMENT.
+ */
+
+package aQute.lib.filter;
+
+import java.lang.reflect.*;
+import java.math.*;
+import java.util.*;
+
+public class Filter {
+    final char     WILDCARD = 65535;
+
+    final int      EQ       = 0;
+    final int      LE       = 1;
+    final int      GE       = 2;
+    final int      APPROX   = 3;
+
+    private String filter;
+
+    abstract class Query {
+        static final String GARBAGE   = "Trailing garbage";
+        static final String MALFORMED = "Malformed query";
+        static final String EMPTY     = "Empty list";
+        static final String SUBEXPR   = "No subexpression";
+        static final String OPERATOR  = "Undefined operator";
+        static final String TRUNCATED = "Truncated expression";
+        static final String EQUALITY  = "Only equality supported";
+
+        private String      tail;
+
+        boolean match() throws IllegalArgumentException {
+            tail = filter;
+            boolean val = doQuery();
+            if (tail.length() > 0)
+                error(GARBAGE);
+            return val;
+        }
+
+        private boolean doQuery() throws IllegalArgumentException {
+            if (tail.length() < 3 || !prefix("("))
+                error(MALFORMED);
+            boolean val;
+
+            switch (tail.charAt(0)) {
+            case '&':
+                val = doAnd();
+                break;
+            case '|':
+                val = doOr();
+                break;
+            case '!':
+                val = doNot();
+                break;
+            default:
+                val = doSimple();
+                break;
+            }
+
+            if (!prefix(")"))
+                error(MALFORMED);
+            return val;
+        }
+
+        private boolean doAnd() throws IllegalArgumentException {
+            tail = tail.substring(1);
+            boolean val = true;
+            if (!tail.startsWith("("))
+                error(EMPTY);
+            do {
+                if (!doQuery())
+                    val = false;
+            } while (tail.startsWith("("));
+            return val;
+        }
+
+        private boolean doOr() throws IllegalArgumentException {
+            tail = tail.substring(1);
+            boolean val = false;
+            if (!tail.startsWith("("))
+                error(EMPTY);
+            do {
+                if (doQuery())
+                    val = true;
+            } while (tail.startsWith("("));
+            return val;
+        }
+
+        private boolean doNot() throws IllegalArgumentException {
+            tail = tail.substring(1);
+            if (!tail.startsWith("("))
+                error(SUBEXPR);
+            return !doQuery();
+        }
+
+        private boolean doSimple() throws IllegalArgumentException {
+            int op = 0;
+            Object attr = getAttr();
+
+            if (prefix("="))
+                op = EQ;
+            else if (prefix("<="))
+                op = LE;
+            else if (prefix(">="))
+                op = GE;
+            else if (prefix("~="))
+                op = APPROX;
+            else
+                error(OPERATOR);
+
+            return compare(attr, op, getValue());
+        }
+
+        private boolean prefix(String pre) {
+            if (!tail.startsWith(pre))
+                return false;
+            tail = tail.substring(pre.length());
+            return true;
+        }
+
+        private Object getAttr() {
+            int len = tail.length();
+            int ix = 0;
+            label: for (; ix < len; ix++) {
+                switch (tail.charAt(ix)) {
+                case '(':
+                case ')':
+                case '<':
+                case '>':
+                case '=':
+                case '~':
+                case '*':
+                case '\\':
+                    break label;
+                }
+            }
+            String attr = tail.substring(0, ix).toLowerCase();
+            tail = tail.substring(ix);
+            return getProp(attr);
+        }
+
+        abstract Object getProp(String key);
+
+        private String getValue() {
+            StringBuffer sb = new StringBuffer();
+            int len = tail.length();
+            int ix = 0;
+            label: for (; ix < len; ix++) {
+                char c = tail.charAt(ix);
+                switch (c) {
+                case '(':
+                case ')':
+                    break label;
+                case '*':
+                    sb.append(WILDCARD);
+                    break;
+                case '\\':
+                    if (ix == len - 1)
+                        break label;
+                    sb.append(tail.charAt(++ix));
+                    break;
+                default:
+                    sb.append(c);
+                    break;
+                }
+            }
+            tail = tail.substring(ix);
+            return sb.toString();
+        }
+
+        private void error(String m) throws IllegalArgumentException {
+            throw new IllegalArgumentException(m + " " + tail);
+        }
+
+        private boolean compare(Object obj, int op, String s) {
+            if (obj == null)
+                return false;
+            try {
+                Class<?> numClass = obj.getClass();
+                if (numClass == String.class) {
+                    return compareString((String) obj, op, s);
+                } else if (numClass == Character.class) {
+                    return compareString(obj.toString(), op, s);
+                } else if (numClass == Long.class) {
+                    return compareSign(op, Long.valueOf(s)
+                            .compareTo((Long) obj));
+                } else if (numClass == Integer.class) {
+                    return compareSign(op, Integer.valueOf(s).compareTo(
+                            (Integer) obj));
+                } else if (numClass == Short.class) {
+                    return compareSign(op, Short.valueOf(s).compareTo(
+                            (Short) obj));
+                } else if (numClass == Byte.class) {
+                    return compareSign(op, Byte.valueOf(s)
+                            .compareTo((Byte) obj));
+                } else if (numClass == Double.class) {
+                    return compareSign(op, Double.valueOf(s).compareTo(
+                            (Double) obj));
+                } else if (numClass == Float.class) {
+                    return compareSign(op, Float.valueOf(s).compareTo(
+                            (Float) obj));
+                } else if (numClass == Boolean.class) {
+                    if (op != EQ)
+                        return false;
+                    int a = Boolean.valueOf(s).booleanValue() ? 1 : 0;
+                    int b = ((Boolean) obj).booleanValue() ? 1 : 0;
+                    return compareSign(op, a - b);
+                } else if (numClass == BigInteger.class) {
+                    return compareSign(op, new BigInteger(s)
+                            .compareTo((BigInteger) obj));
+                } else if (numClass == BigDecimal.class) {
+                    return compareSign(op, new BigDecimal(s)
+                            .compareTo((BigDecimal) obj));
+                } else if (obj instanceof Collection) {
+                    for (Object x : (Collection<?>) obj)
+                        if (compare(x, op, s))
+                            return true;
+                } else if (numClass.isArray()) {
+                    int len = Array.getLength(obj);
+                    for (int i = 0; i < len; i++)
+                        if (compare(Array.get(obj, i), op, s))
+                            return true;
+                }
+            } catch (Exception e) {
+            }
+            return false;
+        }
+    }
+
+    class DictQuery extends Query {
+        private Dictionary<?,?> dict;
+
+        DictQuery(Dictionary<?,?> dict) {
+            this.dict = dict;
+        }
+
+        Object getProp(String key) {
+            return dict.get(key);
+        }
+    }
+
+    public Filter(String filter) throws IllegalArgumentException {
+        // NYI: Normalize the filter string?
+        this.filter = filter;
+        if (filter == null || filter.length() == 0)
+            throw new IllegalArgumentException("Null query");
+    }
+
+    public boolean match(Dictionary<?,?> dict) {
+        try {
+            return new DictQuery(dict).match();
+        } catch (IllegalArgumentException e) {
+            return false;
+        }
+    }
+
+    public String verify() {
+        try {
+            new DictQuery(new Hashtable<Object,Object>()).match();
+        } catch (IllegalArgumentException e) {
+            return e.getMessage();
+        }
+        return null;
+    }
+
+    public String toString() {
+        return filter;
+    }
+
+    public boolean equals(Object obj) {
+        return obj != null && obj instanceof Filter
+                && filter.equals(((Filter) obj).filter);
+    }
+
+    public int hashCode() {
+        return filter.hashCode();
+    }
+
+    boolean compareString(String s1, int op, String s2) {
+        switch (op) {
+        case EQ:
+            return patSubstr(s1, s2);
+        case APPROX:
+            return fixupString(s2).equals(fixupString(s1));
+        default:
+            return compareSign(op, s2.compareTo(s1));
+        }
+    }
+
+    boolean compareSign(int op, int cmp) {
+        switch (op) {
+        case LE:
+            return cmp >= 0;
+        case GE:
+            return cmp <= 0;
+        case EQ:
+            return cmp == 0;
+        default: /* APPROX */
+            return cmp == 0;
+        }
+    }
+
+    String fixupString(String s) {
+        StringBuffer sb = new StringBuffer();
+        int len = s.length();
+        boolean isStart = true;
+        boolean isWhite = false;
+        for (int i = 0; i < len; i++) {
+            char c = s.charAt(i);
+            if (Character.isWhitespace(c)) {
+                isWhite = true;
+            } else {
+                if (!isStart && isWhite)
+                    sb.append(' ');
+                if (Character.isUpperCase(c))
+                    c = Character.toLowerCase(c);
+                sb.append(c);
+                isStart = false;
+                isWhite = false;
+            }
+        }
+        return sb.toString();
+    }
+
+    boolean patSubstr(String s, String pat) {
+        if (s == null)
+            return false;
+        if (pat.length() == 0)
+            return s.length() == 0;
+        if (pat.charAt(0) == WILDCARD) {
+            pat = pat.substring(1);
+            for (;;) {
+                if (patSubstr(s, pat))
+                    return true;
+                if (s.length() == 0)
+                    return false;
+                s = s.substring(1);
+            }
+        } else {
+            if (s.length() == 0 || s.charAt(0) != pat.charAt(0))
+                return false;
+            return patSubstr(s.substring(1), pat.substring(1));
+        }
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/DirectoryInputStream.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/DirectoryInputStream.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/DirectoryInputStream.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,281 @@
+package aQute.lib.putjar;
+
+import java.io.*;
+import java.util.zip.*;
+
+import aQute.libg.fileiterator.*;
+
+public class DirectoryInputStream extends InputStream {
+    final File               root;
+    final FileIterator       fi;
+    File                     element;
+    int                      entries   = 0;
+    int                      state     = START;
+    long                     where     = 0;
+
+    final static int         START     = 0;
+    final static int         HEADER    = 1;
+    final static int         DATA      = 2;
+    final static int         DIRECTORY = 4;
+    final static int         EOF       = 5;
+
+    final static InputStream eof       = new ByteArrayInputStream(new byte[0]);
+    ByteArrayOutputStream    directory = new ByteArrayOutputStream();
+    InputStream              current   = eof;
+
+    public DirectoryInputStream(File dir) {
+        root = dir;
+        fi = new FileIterator(dir);
+    }
+
+    @Override
+    public int read() throws IOException {
+        if (fi == null)
+            return -1;
+
+        int c = current.read();
+        if (c < 0) {
+            next();
+            c = current.read();
+        }
+        if (c >= 0)
+            where++;
+
+        return c;
+    }
+
+    void next() throws IOException {
+        switch (state) {
+        case START:
+        case DATA:
+            nextHeader();
+            break;
+
+        case HEADER:
+            if (element.isFile() && element.length() > 0) {
+                current = new FileInputStream(element);
+                state = DATA;
+            } else
+                nextHeader();
+            break;
+
+        case DIRECTORY:
+            state = EOF;
+            current = eof;
+            break;
+
+        case EOF:
+            break;
+        }
+    }
+
+    private void nextHeader() throws IOException {
+        if (fi.hasNext()) {
+            element = fi.next();
+            state = HEADER;
+            current = getHeader(root, element);
+            entries++;
+        } else {
+            current = getDirectory();
+            state = DIRECTORY;
+        }
+    }
+
+    /**
+     * <pre>
+     *     end of central dir signature    4 bytes  (0x06054b50)
+     *         number of this disk             2 bytes
+     *         number of the disk with the
+     *         start of the central directory  2 bytes
+     *         total number of entries in the
+     *         central directory on this disk  2 bytes
+     *         total number of entries in
+     *         the central directory           2 bytes
+     *         size of the central directory   4 bytes
+     *         offset of start of central
+     *         directory with respect to
+     *         the starting disk number        4 bytes
+     *         .ZIP file comment length        2 bytes
+     *         .ZIP file comment       (variable size)
+     * </pre>
+     * 
+     * @return
+     */
+    InputStream getDirectory() throws IOException {
+        long where = this.where;
+        int sizeDirectory = directory.size();
+
+        writeInt(directory, 0x504b0506); // Signature
+        writeShort(directory, 0); // # of disk
+        writeShort(directory, 0); // # of the disk with start of the central
+        // dir
+        writeShort(directory, entries); // # of entries
+        writeInt(directory, sizeDirectory); // Size of central dir
+        writeInt(directory, (int) where);
+        writeShort(directory, 0);
+
+        directory.close();
+
+        byte[] data = directory.toByteArray();
+        return new ByteArrayInputStream(data);
+    }
+
+    private void writeShort(OutputStream out, int v) throws IOException {
+        for (int i = 0; i < 2; i++) {
+            out.write((byte) (v & 0xFF));
+            v = v >> 8;
+        }
+    }
+
+    private void writeInt(OutputStream out, int v) throws IOException {
+        for (int i = 0; i < 4; i++) {
+            out.write((byte) (v & 0xFF));
+            v = v >> 8;
+        }
+    }
+
+    /**
+     * Local file header:
+     * 
+     * <pre>
+     * 
+     *         local file header signature     4 bytes  (0x04034b50)
+     *         version needed to extract       2 bytes
+     *         general purpose bit flag        2 bytes
+     *         compression method              2 bytes
+     *         last mod file time              2 bytes
+     *         last mod file date              2 bytes
+     *         crc-32                          4 bytes
+     *         compressed size                 4 bytes
+     *         uncompressed size               4 bytes
+     *         file name length                2 bytes
+     *         extra field length              2 bytes
+     * 
+     *         file name (variable size)
+     *         extra field (variable size)
+     * 
+     *     central file header signature   4 bytes  (0x02014b50)
+     *         version made by                 2 bytes
+     *         version needed to extract       2 bytes
+     *         general purpose bit flag        2 bytes
+     *         compression method              2 bytes
+     *         last mod file time              2 bytes
+     *         last mod file date              2 bytes
+     *         crc-32                          4 bytes
+     *         compressed size                 4 bytes
+     *         uncompressed size               4 bytes
+     *         file name length                2 bytes
+     *         extra field length              2 bytes
+     *         file comment length             2 bytes
+     *         disk number start               2 bytes
+     *         internal file attributes        2 bytes
+     *         external file attributes        4 bytes
+     *         relative offset of local header 4 bytes
+     * 
+     *         file name (variable size)
+     *         extra field (variable size)
+     *         file comment (variable size)
+     * </pre>
+     * </pre>
+     * 
+     * @param file
+     * @return
+     */
+    private InputStream getHeader(File root, File file) throws IOException {
+        long where = this.where;
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        // Signature
+        writeInt(bout, 0x04034b50);
+        writeInt(directory, 0x504b0102);
+
+        // Version needed to extract
+        writeShort(directory, 0);
+
+        // Version needed to extract
+        writeShort(bout, 10);
+        writeShort(directory, 10);
+
+        // General purpose bit flag (use descriptor)
+        writeShort(bout, 0); // descriptor follows data
+        writeShort(directory, 0); // descriptor follows data
+
+        // Compresson method (stored)
+        writeShort(bout, 0);
+        writeShort(directory, 0);
+
+        // Mod time
+        writeInt(bout, 0);
+        writeInt(directory, 0);
+
+        if (file.isDirectory()) {
+            writeInt(bout, 0); // CRC
+            writeInt(bout, 0); // Compressed size
+            writeInt(bout, 0); // Uncompressed Size
+            writeInt(directory, 0);
+            writeInt(directory, 0);
+            writeInt(directory, 0);
+        } else {
+            CRC32 crc = getCRC(file);
+            writeInt(bout, (int) crc.getValue());
+            writeInt(bout, (int) file.length());
+            writeInt(bout, (int) file.length());
+            writeInt(directory, (int) crc.getValue());
+            writeInt(directory, (int) file.length());
+            writeInt(directory, (int) file.length());
+        }
+
+        String p = getPath(root, file);
+        if (file.isDirectory())
+            p = p + "/";
+        byte[] path = p.getBytes("UTF-8");
+        writeShort(bout, path.length);
+        writeShort(directory, path.length);
+
+        writeShort(bout, 0); // extra length
+        writeShort(directory, 0);
+
+        bout.write(path);
+
+        writeShort(directory, 0); // File comment length
+        writeShort(directory, 0); // disk number start 2 bytes
+        writeShort(directory, 0); // internal file attributes 2 bytes
+        writeInt(directory, 0); // external file attributes 4 bytes
+        writeInt(directory, (int) where); // relative offset of local header 4
+        // bytes
+
+        directory.write(path);
+
+        byte[] bytes = bout.toByteArray();
+        return new ByteArrayInputStream(bytes);
+    }
+
+    private String getPath(File root, File file) {
+        if (file.equals(root))
+            return "";
+
+        String p = getPath(root, file.getParentFile());
+        if (p.length() == 0)
+            p = file.getName();
+        else {
+            p = p + "/" + file.getName();
+        }
+        return p;
+    }
+
+    private CRC32 getCRC(File file) throws IOException {
+        CRC32 crc = new CRC32();
+        FileInputStream in = new FileInputStream(file);
+        try {
+            byte data[] = new byte[10000];
+            int size = in.read(data);
+            while (size > 0) {
+                crc.update(data, 0, size);
+                size = in.read(data);
+            }
+        } finally {
+            in.close();
+        }
+        return crc;
+    }
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/TestDirectoryInputStream.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/TestDirectoryInputStream.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/putjar/TestDirectoryInputStream.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,22 @@
+package aQute.lib.putjar;
+
+import java.io.*;
+import java.util.jar.*;
+
+import junit.framework.*;
+
+public class TestDirectoryInputStream extends TestCase {
+
+    public void testComplete() throws IOException {
+        DirectoryInputStream din2 = new DirectoryInputStream(new File("dir"));
+        JarInputStream in = new JarInputStream(din2);
+        assertNotNull(in.getManifest());
+        JarEntry entry = in.getNextJarEntry();
+        while (entry != null) {
+            System.out.println(entry.getName());
+            entry = in.getNextJarEntry();
+        }
+
+        in.close();
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/tag/Tag.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/tag/Tag.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/lib/tag/Tag.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,457 @@
+package aQute.lib.tag;
+
+import java.io.*;
+import java.text.*;
+import java.util.*;
+
+/**
+ * The Tag class represents a minimal XML tree. It consist of a named element
+ * with a hashtable of named attributes. Methods are provided to walk the tree
+ * and get its constituents. The content of a Tag is a list that contains String
+ * objects or other Tag objects.
+ */
+public class Tag {
+    Tag                       parent;                               // Parent
+    // element
+    String                    name;                                 // Name
+    // of
+    // the
+    // tag
+    final Map<String, String> attributes;
+    // name
+    // ->
+    // value
+    final List<Object>        content = new ArrayList<Object>();    // Content
+    // elements
+
+    static SimpleDateFormat   format  = new SimpleDateFormat(
+                                              "yyyyMMddhhmmss.SSS");
+
+    /**
+     * Construct a new Tag with a name.
+     */
+    public Tag(String name) {
+        this.name = name;
+        attributes = new LinkedHashMap<String, String>(); // Attributes
+    }
+
+    /**
+     * Construct a new Tag with a name.
+     */
+    public Tag(String name, Map<String, String> attributes) {
+        this.name = name;
+        this.attributes = attributes;
+    }
+
+    /**
+     * Construct a new Tag with a name and a set of attributes. The attributes
+     * are given as ( name, value ) ...
+     */
+    public Tag(String name, String[] attributes) {
+        this.name = name;
+        this.attributes = new LinkedHashMap<String, String>(); // Attributes
+        for (int i = 0; i < attributes.length; i += 2)
+            addAttribute(attributes[i], attributes[i + 1]);
+    }
+
+    /**
+     * Construct a new Tag with a single string as content.
+     */
+    public Tag(String name, String content) {
+        this.name = name;
+        attributes = new LinkedHashMap<String, String>(); // Attributes
+        addContent(content);
+    }
+
+    /**
+     * Add a new attribute.
+     */
+    public void addAttribute(String key, String value) {
+        attributes.put(key, value);
+    }
+
+    /**
+     * Add a new attribute.
+     */
+    public void addAttribute(String key, Object value) {
+        if (value == null)
+            return;
+        attributes.put(key, value.toString());
+    }
+
+    /**
+     * Add a new attribute.
+     */
+    public void addAttribute(String key, int value) {
+        attributes.put(key, Integer.toString(value));
+    }
+
+    /**
+     * Add a new date attribute. The date is formatted as the SimpleDateFormat
+     * describes at the top of this class.
+     */
+    public void addAttribute(String key, Date value) {
+        attributes.put(key, format.format(value));
+    }
+
+    /**
+     * Add a new content string.
+     */
+    public void addContent(String string) {
+        content.add(string);
+    }
+
+    /**
+     * Add a new content tag.
+     */
+    public void addContent(Tag tag) {
+        content.add(tag);
+        tag.parent = this;
+    }
+
+    /**
+     * Return the name of the tag.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Return the attribute value.
+     */
+    public String getAttribute(String key) {
+        return (String) attributes.get(key);
+    }
+
+    /**
+     * Return the attribute value or a default if not defined.
+     */
+    public String getAttribute(String key, String deflt) {
+        String answer = getAttribute(key);
+        return answer == null ? deflt : answer;
+    }
+
+    /**
+     * Answer the attributes as a Dictionary object.
+     */
+    public Map<String, String> getAttributes() {
+        return attributes;
+    }
+
+    /**
+     * Return the contents.
+     */
+    public List<Object> getContents() {
+        return content;
+    }
+
+    /**
+     * Return a string representation of this Tag and all its children
+     * recursively.
+     */
+    public String toString() {
+        StringWriter sw = new StringWriter();
+        print(0, new PrintWriter(sw));
+        return sw.toString();
+    }
+
+    /**
+     * Return only the tags of the first level of descendants that match the
+     * name.
+     */
+    public List<Object> getContents(String tag) {
+        List<Object> out = new ArrayList<Object>();
+        for (Object o : out) {
+            if (o instanceof Tag && ((Tag) o).getName().equals(tag))
+                out.add(o);
+        }
+        return out;
+    }
+
+    /**
+     * Return the whole contents as a String (no tag info and attributes).
+     */
+    public String getContentsAsString() {
+        StringBuffer sb = new StringBuffer();
+        getContentsAsString(sb);
+        return sb.toString();
+    }
+
+    /**
+     * convenient method to get the contents in a StringBuffer.
+     */
+    public void getContentsAsString(StringBuffer sb) {
+        for (Object o : content) {
+            if (o instanceof Tag)
+                ((Tag) o).getContentsAsString(sb);
+            else
+                sb.append(o.toString());
+        }
+    }
+
+    /**
+     * Print the tag formatted to a PrintWriter.
+     */
+    public void print(int indent, PrintWriter pw) {
+        pw.print("\n");
+        spaces(pw, indent);
+        pw.print('<');
+        pw.print(name);
+
+        for (String key : attributes.keySet()) {
+            String value = escape(attributes.get(key));
+            pw.print(' ');
+            pw.print(key);
+            pw.print("=");
+            String quote = "'";
+            if (value.indexOf(quote) >= 0)
+                quote = "\"";
+            pw.print(quote);
+            pw.print(value);
+            pw.print(quote);
+        }
+
+        if (content.size() == 0)
+            pw.print('/');
+        else {
+            pw.print('>');
+            for (Object c : content) {
+                if (c instanceof String) {
+                    formatted(pw, indent + 2, 60, escape((String) c));
+                } else if (c instanceof Tag) {
+                    Tag tag = (Tag) c;
+                    tag.print(indent + 2, pw);
+                }
+            }
+            pw.print("\n");
+            spaces(pw, indent);
+            pw.print("</");
+            pw.print(name);
+        }
+        pw.print('>');
+    }
+
+    /**
+     * Convenience method to print a string nicely and does character conversion
+     * to entities.
+     */
+    void formatted(PrintWriter pw, int left, int width, String s) {
+        int pos = width + 1;
+        s = s.trim();
+
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            if (i == 0 || (Character.isWhitespace(c) && pos > width - 3)) {
+                pw.print("\n");
+                spaces(pw, left);
+                pos = 0;
+            }
+            switch (c) {
+            case '<':
+                pw.print("&lt;");
+                pos += 4;
+                break;
+            case '>':
+                pw.print("&gt;");
+                pos += 4;
+                break;
+            case '&':
+                pw.print("&amp;");
+                pos += 5;
+                break;
+            default:
+                pw.print(c);
+                pos++;
+                break;
+            }
+
+        }
+    }
+
+    /**
+     * Escape a string, do entity conversion.
+     */
+    String escape(String s) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            switch (c) {
+            case '<':
+                sb.append("&lt;");
+                break;
+            case '>':
+                sb.append("&gt;");
+                break;
+            case '&':
+                sb.append("&amp;");
+                break;
+            default:
+                sb.append(c);
+                break;
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Make spaces.
+     */
+    void spaces(PrintWriter pw, int n) {
+        while (n-- > 0)
+            pw.print(' ');
+    }
+
+    /**
+     * root/preferences/native/os
+     */
+    public Collection<Tag> select(String path) {
+        return select(path, (Tag) null);
+    }
+
+    public Collection<Tag> select(String path, Tag mapping) {
+        List<Tag> v = new ArrayList<Tag>();
+        select(path, v, mapping);
+        return v;
+    }
+
+    void select(String path, List<Tag> results, Tag mapping) {
+        if (path.startsWith("//")) {
+            int i = path.indexOf('/', 2);
+            String name = path.substring(2, i < 0 ? path.length() : i);
+
+            for (Object o : content) {
+                if (o instanceof Tag) {
+                    Tag child = (Tag) o;
+                    if (match(name, child, mapping))
+                        results.add(child);
+                    child.select(path, results, mapping);
+                }
+
+            }
+            return;
+        }
+
+        if (path.length() == 0) {
+            results.add(this);
+            return;
+        }
+
+        int i = path.indexOf("/");
+        String elementName = path;
+        String remainder = "";
+        if (i > 0) {
+            elementName = path.substring(0, i);
+            remainder = path.substring(i + 1);
+        }
+
+        for (Object o : content) {
+            if (o instanceof Tag) {
+                Tag child = (Tag) o;
+                if (child.getName().equals(elementName)
+                        || elementName.equals("*"))
+                    child.select(remainder, results, mapping);
+            }
+        }
+    }
+
+    public boolean match(String search, Tag child, Tag mapping) {
+        String target = child.getName();
+        String sn = null;
+        String tn = null;
+
+        if (search.equals("*"))
+            return true;
+
+        int s = search.indexOf(':');
+        if (s > 0) {
+            sn = search.substring(0, s);
+            search = search.substring(s + 1);
+        }
+        int t = target.indexOf(':');
+        if (t > 0) {
+            tn = target.substring(0, t);
+            target = target.substring(t + 1);
+        }
+
+        if (!search.equals(target)) // different tag names
+            return false;
+
+        if (mapping == null) {
+            return tn == sn || (sn != null && sn.equals(tn));
+        } else {
+            String suri = sn == null ? mapping.getAttribute("xmlns") : mapping
+                    .getAttribute("xmlns:" + sn);
+            String turi = tn == null ? child.findRecursiveAttribute("xmlns")
+                    : child.findRecursiveAttribute("xmlns:" + tn);
+            return turi == suri
+                    || (turi != null && suri != null && turi.equals(suri));
+        }
+    }
+
+    public String getString(String path) {
+        String attribute = null;
+        int index = path.indexOf("@");
+        if (index >= 0) {
+            // attribute
+            attribute = path.substring(index + 1);
+
+            if (index > 0) {
+                // prefix path
+                path = path.substring(index - 1); // skip -1
+            } else
+                path = "";
+        }
+        Collection<Tag> tags = select(path);
+        StringBuffer sb = new StringBuffer();
+        for (Tag tag : tags) {
+            if (attribute == null)
+                tag.getContentsAsString(sb);
+            else
+                sb.append(tag.getAttribute(attribute));
+        }
+        return sb.toString();
+    }
+
+    public String getStringContent() {
+        StringBuffer sb = new StringBuffer();
+        for (Object c : content) {
+            if (!(c instanceof Tag))
+                sb.append(c);
+        }
+        return sb.toString();
+    }
+
+    public String getNameSpace() {
+        return getNameSpace(name);
+    }
+
+    public String getNameSpace(String name) {
+        int index = name.indexOf(':');
+        if (index > 0) {
+            String ns = name.substring(0, index);
+            return findRecursiveAttribute("xmlns:" + ns);
+        } else
+            return findRecursiveAttribute("xmlns");
+    }
+
+    public String findRecursiveAttribute(String name) {
+        String value = getAttribute(name);
+        if (value != null)
+            return value;
+        if (parent != null)
+            return parent.findRecursiveAttribute(name);
+        return null;
+    }
+
+    public String getLocalName() {
+        int index = name.indexOf(':');
+        if (index <= 0)
+            return name;
+
+        return name.substring(index + 1);
+    }
+
+    public void rename(String string) {
+        name = string;
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/BER.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/BER.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/BER.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,473 @@
+package aQute.libg.asn1;
+
+import java.io.*;
+import java.text.*;
+import java.util.*;
+
+public class BER implements Types {
+    final DataInputStream xin;
+    long                  position;
+
+    public BER(InputStream in) {
+        this.xin = new DataInputStream(in);
+    }
+
+    public void dump(PrintStream out) throws Exception {
+        int type = readByte();
+        long length = readLength();
+        if (type == -1 || length == -1)
+            throw new EOFException("Empty file");
+        dump(out, type, length, "");
+    }
+
+    void dump(PrintStream out, int type, long length, String indent)
+            throws Exception {
+        int clss = type >> 6;
+        int nmbr = type & 0x1F;
+        boolean cnst = (type & 0x20) != 0;
+
+        String tag = "[" + nmbr + "]";
+        if (clss == 0)
+            tag = TAGS[nmbr];
+
+        if (cnst) {
+            System.out.printf("%5d %s %s %s\n", length, indent, CLASSES[clss],
+                    tag);
+            while (length > 1) {
+                long atStart = getPosition();
+                int t2 = read();
+                long l2 = readLength();
+                dump(out, t2, l2, indent + "  ");
+                length -= getPosition() - atStart;
+            }
+        } else {
+            assert length < Integer.MAX_VALUE;
+            assert length >= 0;
+            byte[] data = new byte[(int) length];
+            readFully(data);
+            String summary;
+
+            switch (nmbr) {
+            case BOOLEAN:
+                assert length == 1;
+                summary = data[0] != 0 ? "true" : "false";
+                break;
+
+            case INTEGER:
+                long n = toLong(data);
+                summary = n + "";
+                break;
+
+            case UTF8_STRING:
+            case IA5STRING:
+            case VISIBLE_STRING:
+            case UNIVERSAL_STRING:
+            case PRINTABLE_STRING:
+            case UTCTIME:
+                summary = new String(data, "UTF-8");
+                break;
+
+            case OBJECT_IDENTIFIER:
+                summary = readOID(data);
+                break;
+
+            case GENERALIZED_TIME:
+            case GRAPHIC_STRING:
+            case GENERAL_STRING:
+            case CHARACTER_STRING:
+
+            case REAL:
+            case EOC:
+            case BIT_STRING:
+            case OCTET_STRING:
+            case NULL:
+            case OBJECT_DESCRIPTOR:
+            case EXTERNAL:
+            case ENUMERATED:
+            case EMBEDDED_PDV:
+            case RELATIVE_OID:
+            case NUMERIC_STRING:
+            case T61_STRING:
+            case VIDEOTEX_STRING:
+            case BMP_STRING:
+            default:
+                StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < 10 && i < data.length; i++) {
+                    sb.append(Integer.toHexString(data[i]));
+                }
+                if (data.length > 10) {
+                    sb.append("...");
+                }
+                summary = sb.toString();
+                break;
+            }
+            out.printf("%5d %s %s %s %s\n", length, indent, CLASSES[clss], tag,
+                    summary);
+        }
+    }
+
+    long toLong(byte[] data) {
+        if (data[0] < 0) {
+            for (int i = 0; i < data.length; i++)
+                data[i] = (byte) (0xFF ^ data[i]);
+
+            return -(toLong(data) + 1);
+        }
+        long n = 0;
+        for (int i = 0; i < data.length; i++) {
+            n = n * 256 + data[i];
+        }
+        return n;
+    }
+
+    /**
+     * 8.1.3.3 For the definite form, the length octets shall consist of one or
+     * more octets, and shall represent the number of octets in the contents
+     * octets using either the short form (see 8.1.3.4) or the long form (see
+     * 8.1.3.5) as a sender's option. NOTE – The short form can only be used if
+     * the number of octets in the contents octets is less than or equal to 127.
+     * 8.1.3.4 In the short form, the length octets shall consist of a single
+     * octet in which bit 8 is zero and bits 7 to 1 encode the number of octets
+     * in the contents octets (which may be zero), as an unsigned binary integer
+     * with bit 7 as the most significant bit. EXAMPLE L = 38 can be encoded as
+     * 001001102 8.1.3.5 In the long form, the length octets shall consist of an
+     * initial octet and one or more subsequent octets. The initial octet shall
+     * be encoded as follows: a) bit 8 shall be one; b) bits 7 to 1 shall encode
+     * the number of subsequent octets in the length octets, as an unsigned
+     * binary integer with bit 7 as the most significant bit; c) the value
+     * 111111112 shall not be used. ISO/IEC 8825-1:2003 (E) NOTE 1 – This
+     * restriction is introduced for possible future extension. Bits 8 to 1 of
+     * the first subsequent octet, followed by bits 8 to 1 of the second
+     * subsequent octet, followed in turn by bits 8 to 1 of each further octet
+     * up to and including the last subsequent octet, shall be the encoding of
+     * an unsigned binary integer equal to the number of octets in the contents
+     * octets, with bit 8 of the first subsequent octet as the most significant
+     * bit. EXAMPLE L = 201 can be encoded as: 100000012 110010012 NOTE 2 – In
+     * the long form, it is a sender's option whether to use more length octets
+     * than the minimum necessary. 8.1.3.6 For the indefinite form, the length
+     * octets indicate that the contents octets are terminated by
+     * end-of-contents octets (see 8.1.5), and shall consist of a single octet.
+     * 8.1.3.6.1 The single octet shall have bit 8 set to one, and bits 7 to 1
+     * set to zero. 8.1.3.6.2 If this form of length is used, then
+     * end-of-contents octets (see 8.1.5) shall be present in the encoding
+     * following the contents octets. 8.1.4 Contents octets The contents octets
+     * shall consist of zero, one or more octets, and shall encode the data
+     * value as specified in subsequent clauses. NOTE – The contents octets
+     * depend on the type of the data value; subsequent clauses follow the same
+     * sequence as the definition of types in ASN.1. 8.1.5 End-of-contents
+     * octets The end-of-contents octets shall be present if the length is
+     * encoded as specified in 8.1.3.6, otherwise they shall not be present. The
+     * end-of-contents octets shall consist of two zero octets. NOTE – The
+     * end-of-contents octets can be considered as the encoding of a value whose
+     * tag is universal class, whose form is primitive, whose number of the tag
+     * is zero, and whose contents are absent, thus:
+     * 
+     * End-of-contents Length Contents 0016 0016 Absent
+     * 
+     * @return
+     */
+    private long readLength() throws IOException {
+        long n = readByte();
+        if (n > 0) {
+            // short form
+            return n;
+        } else {
+            // long form
+            int count = (int) (n & 0x7F);
+            if (count == 0) {
+                // indefinite form
+                return 0;
+            } else {
+                n = 0;
+                while (count-- > 0) {
+                    n = n * 256 + read();
+                }
+                return n;
+            }
+        }
+    }
+
+    private int readByte() throws IOException {
+        position++;
+        return xin.readByte();
+    }
+
+    private void readFully(byte[] data) throws IOException {
+        position += data.length;
+        xin.readFully(data);
+    }
+
+    private long getPosition() {
+        return position;
+    }
+
+    private int read() throws IOException {
+        position++;
+        return xin.read();
+    }
+
+    String readOID(byte[] data) {
+        StringBuilder sb = new StringBuilder();
+        sb.append((0xFF & data[0]) / 40);
+        sb.append(".");
+        sb.append((0xFF & data[0]) % 40);
+
+        int i = 0;
+        while (++i < data.length) {
+            int n = 0;
+            while (data[i] < 0) {
+                n = n * 128 + (0x7F & data[i]);
+                i++;
+            }
+            n = n * 128 + data[i];
+            sb.append(".");
+            sb.append(n);
+        }
+
+        return sb.toString();
+    }
+
+    int getPayloadLength(PDU pdu) throws Exception {
+        switch (pdu.getTag() & 0x1F) {
+        case EOC:
+            return 1;
+
+        case BOOLEAN:
+            return 1;
+
+        case INTEGER:
+            return size(pdu.getInt());
+
+        case UTF8_STRING:
+            String s = pdu.getString();
+            byte[] encoded = s.getBytes("UTF-8");
+            return encoded.length;
+
+        case IA5STRING:
+        case VISIBLE_STRING:
+        case UNIVERSAL_STRING:
+        case PRINTABLE_STRING:
+        case GENERALIZED_TIME:
+        case GRAPHIC_STRING:
+        case GENERAL_STRING:
+        case CHARACTER_STRING:
+        case UTCTIME:
+        case NUMERIC_STRING: {
+            String str = pdu.getString();
+            encoded = str.getBytes("ASCII");
+            return encoded.length;
+        }
+
+        case OBJECT_IDENTIFIER:
+        case REAL:
+        case BIT_STRING:
+            return pdu.getBytes().length;
+
+        case OCTET_STRING:
+        case NULL:
+        case OBJECT_DESCRIPTOR:
+        case EXTERNAL:
+        case ENUMERATED:
+        case EMBEDDED_PDV:
+        case RELATIVE_OID:
+        case T61_STRING:
+        case VIDEOTEX_STRING:
+        case BMP_STRING:
+            return pdu.getBytes().length;
+
+        default:
+            throw new IllegalArgumentException("Invalid type: " + pdu);
+        }
+    }
+
+    int size(long value) {
+        if (value < 128)
+            return 1;
+
+        if (value <= 0xFF)
+            return 2;
+
+        if (value <= 0xFFFF)
+            return 3;
+
+        if (value <= 0xFFFFFF)
+            return 4;
+
+        if (value <= 0xFFFFFFFF)
+            return 5;
+
+        if (value <= 0xFFFFFFFFFFL)
+            return 6;
+
+        if (value <= 0xFFFFFFFFFFFFL)
+            return 7;
+
+        if (value <= 0xFFFFFFFFFFFFFFL)
+            return 8;
+
+        if (value <= 0xFFFFFFFFFFFFFFFFL)
+            return 9;
+
+        throw new IllegalArgumentException("length too long");
+    }
+
+    public void write(OutputStream out, PDU pdu) throws Exception {
+        byte id = 0;
+
+        switch (pdu.getClss()) {
+        case UNIVERSAL:
+            id |= 0;
+            break;
+        case APPLICATION:
+            id |= 0x40;
+            break;
+        case CONTEXT:
+            id |= 0x80;
+            break;
+        case PRIVATE:
+            id |= 0xC0;
+            break;
+        }
+
+        if (pdu.isConstructed())
+            id |= 0x20;
+
+        int tag = pdu.getTag();
+        if (tag >= 0 && tag < 31) {
+            id |= tag;
+        } else {
+            throw new UnsupportedOperationException("Cant do tags > 30");
+        }
+
+        out.write(id);
+
+        int length = getPayloadLength(pdu);
+        int size = size(length);
+        if (size == 1) {
+            out.write(length);
+        } else {
+            out.write(size);
+            while (--size >= 0) {
+                byte data = (byte) ((length >> (size * 8)) & 0xFF);
+                out.write(data);
+            }
+        }
+        writePayload(out, pdu);
+    }
+
+    void writePayload(OutputStream out, PDU pdu) throws Exception {
+        switch (pdu.getTag()) {
+        case EOC:
+            out.write(0);
+            break;
+
+        case BOOLEAN:
+            if (pdu.getBoolean())
+                out.write(-1);
+            else
+                out.write(0);
+            break;
+
+        case ENUMERATED:
+        case INTEGER: {
+            long value = pdu.getInt();
+            int size = size(value);
+            for (int i = size; i >= 0; i--) {
+                byte b = (byte) ((value >> (i * 8)) & 0xFF);
+                out.write(b);
+            }
+        }
+
+        case BIT_STRING: {
+            byte bytes[] = pdu.getBytes();
+            int unused = bytes[0];
+            assert unused <= 7;
+            int[] mask = { 0xFF, 0x7F, 0x3F, 0x1F, 0xF, 0x7, 0x3, 0x1 };
+            bytes[bytes.length - 1] &= (byte) mask[unused];
+            out.write(bytes);
+            break;
+        }
+
+        case RELATIVE_OID:
+        case OBJECT_IDENTIFIER: {
+            int[] oid = pdu.getOID();
+            assert oid.length > 2;
+            assert oid[0] < 4;
+            assert oid[1] < 40;
+            byte top = (byte) (oid[0] * 40 + oid[1]);
+            out.write(top);
+            for (int i = 2; i < oid.length; i++) {
+                putOid(out,oid[i]);
+            }
+            break;
+        }
+
+        case OCTET_STRING: {
+            byte bytes[] = pdu.getBytes();
+            out.write(bytes);
+            break;
+        }
+
+        case NULL:
+            break;
+
+        case BMP_STRING:
+        case GRAPHIC_STRING:
+        case VISIBLE_STRING:
+        case GENERAL_STRING:
+        case UNIVERSAL_STRING:
+        case CHARACTER_STRING:
+        case NUMERIC_STRING:
+        case PRINTABLE_STRING:
+        case VIDEOTEX_STRING:
+        case T61_STRING:
+        case REAL:
+        case EMBEDDED_PDV:
+        case EXTERNAL:
+            throw new UnsupportedEncodingException("dont know real, embedded PDV or external");
+            
+        case UTF8_STRING: {
+            String s = pdu.getString();
+            byte [] data = s.getBytes("UTF-8");
+            out.write(data);
+            break;
+        }
+        
+        case OBJECT_DESCRIPTOR:
+        case IA5STRING:
+            String s = pdu.getString();
+            byte [] data = s.getBytes("ASCII");
+            out.write(data);
+            break;
+            
+            
+        case SEQUENCE:
+        case SET: {
+            PDU pdus[] = pdu.getChildren();
+            for ( PDU p : pdus ) {
+                write(out, p);
+            }
+        }
+            
+        
+        case UTCTIME:
+        case GENERALIZED_TIME:
+            Date date = pdu.getDate();
+            String ss= df.format(date);
+            byte d[] = ss.getBytes("ASCII");
+            out.write(d);
+            break;
+            
+        }
+    }
+    static DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss\\Z");
+    
+
+    private void putOid(OutputStream out, int i) throws IOException {
+        if (i > 127) {
+            putOid(out, i >> 7);
+            out.write(0x80 + (i & 0x7F));
+        } else
+            out.write(i & 0x7F);
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/PDU.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/PDU.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/PDU.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,114 @@
+package aQute.libg.asn1;
+
+import java.util.*;
+
+public class PDU implements Types, Iterable<PDU> {
+    final int identifier;
+    final Object  payload;
+    byte data[] = new byte[100];
+
+
+    public PDU(int id, Object payload) {
+        identifier = id;
+        this.payload = payload;
+    }
+
+    public PDU(Date payload) {
+        identifier = UTCTIME;
+        this.payload = payload;
+    }
+
+    public PDU(int n) {
+        this(UNIVERSAL+INTEGER, n);
+    }
+
+    public PDU(boolean value) {
+        this(UNIVERSAL+BOOLEAN, value);
+    }
+
+    public PDU(String s) throws Exception {
+        this(UNIVERSAL+IA5STRING, s);
+    }
+    
+    public PDU(byte[] data) {
+        this(UNIVERSAL+OCTET_STRING, data);
+    }
+    
+    public PDU(BitSet bits) {
+        this(UNIVERSAL+BIT_STRING, bits);
+    }
+
+    public PDU(int top, int l1, int... remainder) {
+        identifier = UNIVERSAL+OBJECT_IDENTIFIER;
+        int[] ids = new int[remainder.length + 2];
+        ids[0] = top;
+        ids[1] = l1;
+        System.arraycopy(remainder, 0, ids, 2, remainder.length);
+        payload = ids;
+    }
+
+    public PDU(int tag, PDU... set) {
+        this(tag,(Object)set);
+    }
+
+    public PDU(PDU... set) {
+        this(SEQUENCE+CONSTRUCTED,set);
+    }
+
+
+    public int getTag() {
+        return identifier & TAGMASK;
+    }
+
+    int getClss() {
+        return identifier & CLASSMASK;
+    }
+
+    public boolean isConstructed() {
+        return (identifier & CONSTRUCTED) != 0;
+    }
+
+    public String getString() {
+        return (String) payload;
+    }
+
+    public Iterator<PDU> iterator() {
+        return Arrays.asList((PDU[]) payload).iterator();
+    }
+
+    
+    public int[] getOID() {
+        assert getTag() == OBJECT_IDENTIFIER;
+        return (int[]) payload;
+    }
+
+    public Boolean getBoolean() {
+        assert getTag() == BOOLEAN;
+        return (Boolean) payload;
+    }
+
+    public BitSet getBits() {
+        assert getTag() == BIT_STRING;
+        return (BitSet) payload;
+    }
+
+    public int getInt() {
+        assert getTag() == INTEGER || getTag() == ENUMERATED;
+        return (Integer) payload;
+    }
+
+    public byte[] getBytes() {
+        return (byte[]) payload;
+    }
+
+    public PDU[] getChildren() {
+        assert isConstructed();
+        return (PDU[]) payload;
+    }
+
+    public Date getDate() {
+        assert getTag() == UTCTIME || getTag() == GENERALIZED_TIME;
+        return (Date) payload;
+    }
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/Types.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/Types.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/Types.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,65 @@
+package aQute.libg.asn1;
+
+public interface Types {
+    int      UNIVERSAL         = 0x00000000;
+    int      APPLICATION       = 0x40000000;
+    int      CONTEXT           = 0x80000000;
+    int      PRIVATE           = 0xC0000000;
+    int      CLASSMASK         = 0xC0000000;
+    int      CONSTRUCTED       = 0x20000000;
+    int      TAGMASK           = 0x1FFFFFFF;
+
+    String [] CLASSES = {"U", "A", "C", "P"};
+    
+    // Payload Primitve
+    int      EOC               = 0;                                // null
+    // x
+    int      BOOLEAN           = 1;                                // Boolean
+    // x
+    int      INTEGER           = 2;                                // Long
+    // x
+    int      BIT_STRING        = 3;                                // byte
+    // [] -
+    int      OCTET_STRING      = 4;                                // byte
+    // [] -
+    int      NULL              = 5;                                // null
+    // x
+    int      OBJECT_IDENTIFIER = 6;                                // int[]
+    // x
+    int      OBJECT_DESCRIPTOR = 7;                                // 
+    int      EXTERNAL          = 8;                                //
+    int      REAL              = 9;                                // double
+    // x
+    int      ENUMERATED        = 10;                               // 
+    int      EMBEDDED_PDV      = 11;                               //
+    int      UTF8_STRING       = 12;                               // String
+    int      RELATIVE_OID      = 13;                               // 
+    int      SEQUENCE          = 16;                               // 
+    int      SET               = 17;
+    int      NUMERIC_STRING    = 18;                               // String
+    int      PRINTABLE_STRING  = 19;                               // String
+    int      T61_STRING        = 20;                               // String
+    int      VIDEOTEX_STRING   = 21;                               // String
+    int      IA5STRING         = 22;                               // String
+    int      UTCTIME           = 23;                               // Date
+    int      GENERALIZED_TIME  = 24;                               // Date
+    int      GRAPHIC_STRING    = 25;                               // String
+    int      VISIBLE_STRING    = 26;                               // String
+    int      GENERAL_STRING    = 27;                               // String
+    int      UNIVERSAL_STRING  = 28;                               // String
+    int      CHARACTER_STRING  = 29;                               // String
+    int      BMP_STRING        = 30;                               // byte[]
+
+    String[] TAGS              = { "EOC               ",
+            "BOOLEAN           ", "INTEGER           ", "BIT_STRING        ",
+            "OCTET_STRING      ", "NULL              ", "OBJECT_IDENTIFIER ",
+            "OBJECT_DESCRIPTOR ", "EXTERNAL          ", "REAL              ",
+            "ENUMERATED        ", "EMBEDDED_PDV      ", "UTF8_STRING       ",
+            "RELATIVE_OID      ", "?(14)             ", "?(15)             ",
+            "SEQUENCE          ", "SET               ", "NUMERIC_STRING    ",
+            "PRINTABLE_STRING  ", "T61_STRING        ", "VIDEOTEX_STRING   ",
+            "IA5STRING         ", "UTCTIME           ", "GENERALIZED_TIME  ",
+            "GRAPHIC_STRING    ", "VISIBLE_STRING    ", "GENERAL_STRING    ",
+            "UNIVERSAL_STRING  ", "CHARACTER_STRING  ", "BMP_STRING        ", };
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/algorithms
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/algorithms	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/asn1/algorithms	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,22 @@
+---------------------------------------------------------------------------
+SignatureAlgorithm      digestAlgo        (I)  signatureAlgo (RFC 2630)
+                                          (II) digestEncrAlgo(PKCS#7)
+---------------------------------------------------------------------------
+(A) sha1WithRSA            1.3.14.3.2.26  (Ia)     1.2.840.113549.1.1.5
+   (1.2.840.113549.1.1.5)                 (Ib)     1.2.840.113549.1.1.1
+                                          (II)     1.2.840.113549.1.1.1
+
+
+(B) md5WithRSA           1.2.840.1x9.2.5  (Ia)     1.2.840.113549.1.1.4
+   (1.2.840.113549.1.1.4)                 (Ib)     1.2.840.113549.1.1.1
+                                          (II)     1.2.840.113549.1.1.1
+
+
+(C) ripeMD160WithRsa        1.3.36.3.2.1  (Ia)     1.3.36.3.3.1.2
+   (1.3.36.3.3.1.2)                       (Ib)     1.2.840.113549.1.1.1
+                                          (II)     1.2.840.113549.1.1.1
+
+
+(D) sha1WithDsa            1.3.14.3.2.26  (Ia)     1.2.840.10040.4.3
+   (1.2.840.10040.4.3)                    (Ib)     1.2.840.10040.4.1 (?)
+                                          (II)     1.2.840.10040.4.1

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/classdump/ClassDumper.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/classdump/ClassDumper.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/classdump/ClassDumper.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,654 @@
+/* Copyright 2006 aQute SARL 
+ * Licensed under the Apache License, Version 2.0, see http://www.apache.org/licenses/LICENSE-2.0 */
+package aQute.libg.classdump;
+
+import java.io.*;
+import java.lang.reflect.*;
+
+public class ClassDumper {
+    final static protected class Assoc {
+        Assoc(byte tag, int a, int b) {
+            this.tag = tag;
+            this.a = a;
+            this.b = b;
+        }
+
+        byte tag;
+        int  a;
+        int  b;
+
+    }
+
+    final String        path;
+    final static String NUM_COLUMN = "%-30s %d\n";
+    final static String HEX_COLUMN = "%-30s %x\n";
+    final static String STR_COLUMN = "%-30s %s\n";
+
+    PrintStream         ps         = System.out;
+    Object[]            pool;
+    InputStream         in;
+
+    public ClassDumper(String path) throws Exception {
+        this(path, new FileInputStream(new File(path)));
+    }
+
+    public ClassDumper(String path, InputStream in) throws IOException {
+        this.path = path;
+        this.in = in;
+    }
+
+    public void dump(PrintStream ps) throws Exception {
+        if (ps != null)
+            this.ps = ps;
+        DataInputStream din = new DataInputStream(in);
+        parseClassFile(din);
+        din.close();
+    }
+
+    void parseClassFile(DataInputStream in) throws IOException {
+        int magic = in.readInt();
+        if (magic != 0xCAFEBABE)
+            throw new IOException("Not a valid class file (no CAFEBABE header)");
+
+        ps.printf(HEX_COLUMN, "magic", magic);
+        int minor = in.readUnsignedShort(); // minor version
+        int major = in.readUnsignedShort(); // major version
+        ps.printf(STR_COLUMN, "version", "" + major + "." + minor);
+        int pool_size = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, "pool size", pool_size);
+        pool = new Object[pool_size];
+
+        process: for (int poolIndex = 1; poolIndex < pool_size; poolIndex++) {
+            byte tag = in.readByte();
+
+            switch (tag) {
+            case 0:
+                ps.printf("%30d tag (0)\n", poolIndex);
+                break process;
+
+            case 1:
+                String name = in.readUTF();
+                pool[poolIndex] = name;
+                ps.printf("%30d tag(1) utf8 '%s'\n", poolIndex, name);
+                break;
+
+            case 2:
+                throw new IOException("Invalid tag " + tag);
+
+            case 3:
+                int i = in.readInt();
+                pool[poolIndex] = new Integer(i);
+                ps.printf("%30d tag(3) int %s\n", poolIndex, i);
+                break;
+
+            case 4:
+                float f = in.readFloat();
+                pool[poolIndex] = new Float(f);
+                ps.printf("%30d tag(4) float %s\n", poolIndex, f);
+                break;
+
+            // For some insane optimization reason are
+            // the long and the double two entries in the
+            // constant pool. See 4.4.5
+            case 5:
+                long l = in.readLong();
+                pool[poolIndex] = new Long(l);
+                ps.printf("%30d tag(5) long %s\n", poolIndex, l);
+                poolIndex++;
+                break;
+
+            case 6:
+                double d = in.readDouble();
+                pool[poolIndex] = new Double(d);
+                ps.printf("%30d tag(6) double %s\n", poolIndex, d);
+                poolIndex++;
+                break;
+
+            case 7:
+                int class_index = in.readUnsignedShort();
+                pool[poolIndex] = new Integer(class_index);
+                ps.printf("%30d tag(7) constant classs %d\n", poolIndex,
+                        class_index);
+                break;
+
+            case 8:
+                int string_index = in.readUnsignedShort();
+                pool[poolIndex] = new Integer(string_index);
+                ps.printf("%30d tag(8) constant string %d\n", poolIndex,
+                        string_index);
+                break;
+
+            case 9: // Field ref
+                class_index = in.readUnsignedShort();
+                int name_and_type_index = in.readUnsignedShort();
+                pool[poolIndex] = new Assoc((byte) 9, class_index,
+                        name_and_type_index);
+                ps.printf("%30d tag(9) field ref %d/%d\n", poolIndex,
+                        class_index, name_and_type_index);
+                break;
+
+            case 10: // Method ref
+                class_index = in.readUnsignedShort();
+                name_and_type_index = in.readUnsignedShort();
+                pool[poolIndex] = new Assoc((byte) 10, class_index,
+                        name_and_type_index);
+                ps.printf("%30d tag(10) method ref %d/%d\n", poolIndex,
+                        class_index, name_and_type_index);
+                break;
+
+            case 11: // Interface and Method ref
+                class_index = in.readUnsignedShort();
+                name_and_type_index = in.readUnsignedShort();
+                pool[poolIndex] = new Assoc((byte) 11, class_index,
+                        name_and_type_index);
+                ps.printf("%30d tag(11) interface and method ref %d/%d\n",
+                        poolIndex, class_index, name_and_type_index);
+                break;
+
+            // Name and Type
+            case 12:
+                int name_index = in.readUnsignedShort();
+                int descriptor_index = in.readUnsignedShort();
+                pool[poolIndex] = new Assoc(tag, name_index, descriptor_index);
+                ps.printf("%30d tag(12) name and type %d/%d\n", poolIndex,
+                        name_index, descriptor_index);
+                break;
+
+            default:
+                throw new IllegalArgumentException("Unknown tag: " + tag);
+            }
+        }
+
+        int access = in.readUnsignedShort(); // access
+        printAccess(access);
+        int this_class = in.readUnsignedShort();
+        int super_class = in.readUnsignedShort();
+        ps.printf("%-30s %x %s(#%d)\n", "this_class", access, pool[this_class],
+                this_class);
+        ps.printf("%-30s %s(#%d)\n", "super_class", pool[super_class],
+                super_class);
+
+        int interfaces_count = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, "interface count", interfaces_count);
+        for (int i = 0; i < interfaces_count; i++) {
+            int interface_index = in.readUnsignedShort();
+            ps.printf("%-30s interface %s(#%d)", "interface count",
+                    pool[interface_index], interfaces_count);
+        }
+
+        int field_count = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, "field count", field_count);
+        for (int i = 0; i < field_count; i++) {
+            access = in.readUnsignedShort(); // access
+            printAccess(access);
+            int name_index = in.readUnsignedShort();
+            int descriptor_index = in.readUnsignedShort();
+            ps.printf("%-30s %x %s(#%d) %s(#%d)\n", "field def", access,
+                    pool[name_index], name_index, pool[descriptor_index],
+                    descriptor_index);
+            doAttributes(in, "  ");
+        }
+
+        int method_count = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, "method count", method_count);
+        for (int i = 0; i < method_count; i++) {
+            int access_flags = in.readUnsignedShort();
+            printAccess(access_flags);
+            int name_index = in.readUnsignedShort();
+            int descriptor_index = in.readUnsignedShort();
+            ps.printf("%-30s %x %s(#%d) %s(#%d)\n", "method def", access_flags,
+                    pool[name_index], name_index, pool[descriptor_index],
+                    descriptor_index);
+            doAttributes(in, "  ");
+        }
+
+        doAttributes(in, "");
+        if (in.read() >= 0)
+            ps.printf("Extra bytes follow ...");
+    }
+
+    /**
+     * Called for each attribute in the class, field, or method.
+     * 
+     * @param in
+     *            The stream
+     * @throws IOException
+     */
+    private void doAttributes(DataInputStream in, String indent)
+            throws IOException {
+        int attribute_count = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "attribute count", attribute_count);
+        for (int j = 0; j < attribute_count; j++) {
+            doAttribute(in, indent + j + ": ");
+        }
+    }
+
+    /**
+     * Process a single attribute, if not recognized, skip it.
+     * 
+     * @param in
+     *            the data stream
+     * @throws IOException
+     */
+    private void doAttribute(DataInputStream in, String indent)
+            throws IOException {
+        int attribute_name_index = in.readUnsignedShort();
+        long attribute_length = in.readInt();
+        attribute_length &= 0xFFFF;
+        String attributeName = (String) pool[attribute_name_index];
+        ps.printf("%-30s %s(#%d)\n", indent + "attribute", attributeName,
+                attribute_name_index);
+        if ("RuntimeVisibleAnnotations".equals(attributeName))
+            doAnnotations(in, indent);
+        else if ("SourceFile".equals(attributeName))
+            doSourceFile(in, indent);
+        else if ("Code".equals(attributeName))
+            doCode(in, indent);
+        else if ("LineNumberTable".equals(attributeName))
+            doLineNumberTable(in, indent);
+        else if ("LocalVariableTable".equals(attributeName))
+            doLocalVariableTable(in, indent);
+        else if ("InnerClasses".equals(attributeName))
+            doInnerClasses(in, indent);
+        else if ("Exceptions".equals(attributeName))
+            doExceptions(in, indent);
+        else if ("EnclosingMethod".equals(attributeName))
+            doEnclosingMethod(in, indent);
+        else if ("Signature".equals(attributeName))
+            doSignature(in, indent);
+        else if ("Synthetic".equals(attributeName))
+            ; // Is empty!
+        else if ("Deprecated".equals(attributeName))
+            ; // Is Empty
+        else {
+            ps.printf("%-30s %d\n", indent + "Unknown attribute, skipping",
+                    attribute_length);
+            if (attribute_length > 0x7FFFFFFF) {
+                throw new IllegalArgumentException("Attribute > 2Gb");
+            }
+            byte buffer[] = new byte[(int) attribute_length];
+            in.readFully(buffer);
+            printHex(buffer);
+        }
+    }
+
+    /**
+     * <pre>
+     * Signature_attribute {
+     * 	u2 attribute_name_index;
+     * 	u4 attribute_length;
+     * 	u2 signature_index;
+     * 	}
+     * </pre>
+     * 
+     * @param in
+     * @param indent
+     */
+    void doSignature(DataInputStream in, String indent) throws IOException {
+        int signature_index = in.readUnsignedShort();
+        ps.printf("%-30s %s(#%d)\n", indent + "signature", pool[signature_index],
+                signature_index);
+    }
+
+    /**
+     * <pre>
+     * EnclosingMethod_attribute {
+     * 	u2 attribute_name_index;
+     * 	u4 attribute_length;
+     * 	u2 class_index
+     * 	u2 method_index;
+     * 	}
+     * 	
+     * </pre>
+     */
+    void doEnclosingMethod(DataInputStream in, String indent)
+            throws IOException {
+        int class_index = in.readUnsignedShort();
+        int method_index = in.readUnsignedShort();
+        ps.printf("%-30s %s(#%d/c) %s(#%d)\n", indent + "enclosing method",
+                pool[((Integer) pool[class_index]).intValue()], class_index,
+                (method_index == 0 ? "<>" : pool[method_index]));
+    }
+
+    /**
+     * <pre>
+     *  Exceptions_attribute {
+     * 		u2 attribute_name_index;
+     * 		u4 attribute_length;
+     * 		u2 number_of_exceptions;
+     * 		u2 exception_index_table[number_of_exceptions];
+     * 	}
+     * </pre>
+     * 
+     * @param in
+     * @param indent
+     */
+    private void doExceptions(DataInputStream in, String indent)
+            throws IOException {
+        int number_of_exceptions = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "number of exceptions",
+                number_of_exceptions);
+        StringBuffer sb = new StringBuffer();
+        String del = "";
+        for (int i = 0; i < number_of_exceptions; i++) {
+            int exception_index_table = in.readUnsignedShort();
+            sb.append(del);
+            sb.append(pool[((Integer) pool[exception_index_table])]);
+            sb.append("(#");
+            sb.append(exception_index_table);
+            sb.append("/c)");
+            del = ", ";
+        }
+        ps.printf("%-30s %d: %s\n", indent + "exceptions",
+                number_of_exceptions, sb);
+    }
+
+    /**
+     * <pre>
+     * Code_attribute {
+     * 		u2 attribute_name_index;
+     * 		u4 attribute_length;
+     * 		u2 max_stack;
+     * 		u2 max_locals;
+     * 		u4 code_length;
+     * 		u1 code[code_length];
+     * 		u2 exception_table_length;
+     * 		{    	u2 start_pc;
+     * 		      	u2 end_pc;
+     * 		      	u2  handler_pc;
+     * 		      	u2  catch_type;
+     * 		}	exception_table[exception_table_length];
+     * 		u2 attributes_count;
+     * 		attribute_info attributes[attributes_count];
+     * 	}
+     * </pre>
+     * 
+     * @param in
+     * @param pool
+     * @throws IOException
+     */
+    private void doCode(DataInputStream in, String indent) throws IOException {
+        int max_stack = in.readUnsignedShort();
+        int max_locals = in.readUnsignedShort();
+        int code_length = in.readInt();
+        ps.printf(NUM_COLUMN, indent + "max_stack", max_stack);
+        ps.printf(NUM_COLUMN, indent + "max_locals", max_locals);
+        ps.printf(NUM_COLUMN, indent + "code_length", code_length);
+        byte code[] = new byte[code_length];
+        in.readFully(code);
+        printHex(code);
+        int exception_table_length = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "exception_table_length",
+                exception_table_length);
+
+        for (int i = 0; i < exception_table_length; i++) {
+            int start_pc = in.readUnsignedShort();
+            int end_pc = in.readUnsignedShort();
+            int handler_pc = in.readUnsignedShort();
+            int catch_type = in.readUnsignedShort();
+            ps.printf("%-30s %d/%d/%d/%d\n", indent + "exception_table",
+                    start_pc, end_pc, handler_pc, catch_type);
+        }
+        doAttributes(in, indent + "  ");
+    }
+
+    /**
+     * We must find Class.forName references ...
+     * 
+     * @param code
+     */
+    protected void printHex(byte[] code) {
+        int index = 0;
+        while (index < code.length) {
+            StringBuilder sb = new StringBuilder();
+            for (int i = 0; i < 16 && index < code.length; i++) {
+                String s = Integer.toHexString((0xFF & code[index++]))
+                        .toUpperCase();
+                if (s.length() == 1)
+                    sb.append("0");
+                sb.append(s);
+                sb.append(" ");
+            }
+            ps.printf(STR_COLUMN, "", sb.toString());
+        }
+    }
+
+    private void doSourceFile(DataInputStream in, String indent)
+            throws IOException {
+        int sourcefile_index = in.readUnsignedShort();
+        ps.printf("%-30s %s(#%d)\n", indent + "Source file",
+                pool[sourcefile_index], sourcefile_index);
+    }
+
+    private void doAnnotations(DataInputStream in, String indent)
+            throws IOException {
+        int num_annotations = in.readUnsignedShort(); // # of annotations
+        ps
+                .printf(NUM_COLUMN, indent + "Number of annotations",
+                        num_annotations);
+        for (int a = 0; a < num_annotations; a++) {
+            doAnnotation(in, indent);
+        }
+    }
+
+    private void doAnnotation(DataInputStream in, String indent)
+            throws IOException {
+        int type_index = in.readUnsignedShort();
+        ps.printf("%-30s %s(#%d)", indent + "type", pool[type_index],
+                type_index);
+        int num_element_value_pairs = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "num_element_value_pairs",
+                num_element_value_pairs);
+        for (int v = 0; v < num_element_value_pairs; v++) {
+            int element_name_index = in.readUnsignedShort();
+            ps.printf(NUM_COLUMN, indent + "element_name_index",
+                    element_name_index);
+            doElementValue(in, indent);
+        }
+    }
+
+    private void doElementValue(DataInputStream in, String indent)
+            throws IOException {
+        int tag = in.readUnsignedByte();
+        switch (tag) {
+        case 'B':
+        case 'C':
+        case 'D':
+        case 'F':
+        case 'I':
+        case 'J':
+        case 'S':
+        case 'Z':
+        case 's':
+            int const_value_index = in.readUnsignedShort();
+            ps.printf("%-30s %c %s(#%d)\n", indent + "element value", tag,
+                    pool[const_value_index], const_value_index);
+            break;
+
+        case 'e':
+            int type_name_index = in.readUnsignedShort();
+            int const_name_index = in.readUnsignedShort();
+            ps.printf("%-30s %c %s(#%d) %s(#%d)\n", indent + "type+const", tag,
+                    pool[type_name_index], type_name_index,
+                    pool[const_name_index], const_name_index);
+            break;
+
+        case 'c':
+            int class_info_index = in.readUnsignedShort();
+            ps.printf("%-30s %c %s(#%d)\n", indent + "element value", tag,
+                    pool[class_info_index], class_info_index);
+            break;
+
+        case '@':
+            ps.printf("%-30s %c\n", indent + "sub annotation", tag);
+            doAnnotation(in, indent);
+            break;
+
+        case '[':
+            int num_values = in.readUnsignedShort();
+            ps.printf("%-30s %c num_values=%d\n", indent + "sub element value",
+                    tag, num_values);
+            for (int i = 0; i < num_values; i++) {
+                doElementValue(in, indent);
+            }
+            break;
+
+        default:
+            throw new IllegalArgumentException(
+                    "Invalid value for Annotation ElementValue tag " + tag);
+        }
+    }
+
+    /**
+     * <pre>
+     *  LineNumberTable_attribute {
+     * 		u2 attribute_name_index;
+     * 		u4 attribute_length;
+     * 		u2 line_number_table_length;
+     * 		{  u2 start_pc;	     
+     * 		   u2 line_number;	     
+     * 		} line_number_table[line_number_table_length];
+     * 	}
+     * 	
+     * </pre>
+     */
+    void doLineNumberTable(DataInputStream in, String indent)
+            throws IOException {
+        int line_number_table_length = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "line number table length",
+                line_number_table_length);
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < line_number_table_length; i++) {
+            int start_pc = in.readUnsignedShort();
+            int line_number = in.readUnsignedShort();
+            sb.append(start_pc);
+            sb.append("/");
+            sb.append(line_number);
+            sb.append(" ");
+        }
+        ps.printf("%-30s %d: %s\n", indent + "line number table",
+                line_number_table_length, sb);
+    }
+
+    /**
+     * 
+     * <pre>
+     * 	LocalVariableTable_attribute {
+     * 		u2 attribute_name_index;
+     * 		u4 attribute_length;
+     * 		u2 local_variable_table_length;
+     * 		{  u2 start_pc;
+     * 		    u2 length;
+     * 		    u2 name_index;
+     * 		    u2 descriptor_index;
+     * 		    u2 index;
+     * 		} local_variable_table[local_variable_table_length];
+     * 	}	
+     * </pre>
+     */
+
+    void doLocalVariableTable(DataInputStream in, String indent)
+            throws IOException {
+        int local_variable_table_length = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "local variable table length",
+                local_variable_table_length);
+        for (int i = 0; i < local_variable_table_length; i++) {
+            int start_pc = in.readUnsignedShort();
+            int length = in.readUnsignedShort();
+            int name_index = in.readUnsignedShort();
+            int descriptor_index = in.readUnsignedShort();
+            int index = in.readUnsignedShort();
+            ps.printf("%-30s %d: %d/%d %s(#%d) %s(#%d)\n", indent, index,
+                    start_pc, length, pool[name_index], name_index,
+                    pool[descriptor_index], descriptor_index);
+        }
+    }
+
+    /**
+     * <pre>
+     *    InnerClasses_attribute {
+     * 		u2 attribute_name_index;
+     * 		u4 attribute_length;
+     * 		u2 number_of_classes;
+     * 		{  u2 inner_class_info_index;	     
+     * 		   u2 outer_class_info_index;	     
+     * 		   u2 inner_name_index;	     
+     * 		   u2 inner_class_access_flags;	     
+     * 		} classes[number_of_classes];
+     * 	}
+     * </pre>
+     * 
+     */
+    void doInnerClasses(DataInputStream in, String indent) throws IOException {
+        int number_of_classes = in.readUnsignedShort();
+        ps.printf(NUM_COLUMN, indent + "number of classes", number_of_classes);
+        for (int i = 0; i < number_of_classes; i++) {
+            int inner_class_info_index = in.readUnsignedShort();
+            int outer_class_info_index = in.readUnsignedShort();
+            int inner_name_index = in.readUnsignedShort();
+            int inner_class_access_flags = in.readUnsignedShort();
+            printAccess(inner_class_access_flags);
+
+            String iname = "<>";
+            String oname = iname;
+
+            if (inner_class_info_index != 0)
+                iname = (String) pool[((Integer) pool[inner_class_info_index])
+                        .intValue()];
+            if (outer_class_info_index != 0)
+                oname = (String) pool[((Integer) pool[outer_class_info_index])
+                        .intValue()];
+
+            ps.printf("%-30s %d: %x %s(#%d/c) %s(#%d/c) %s(#%d) \n", indent, i,
+                    inner_class_access_flags, iname, inner_class_info_index,
+                    oname, outer_class_info_index, pool[inner_name_index],
+                    inner_name_index);
+        }
+    }
+
+    void printAccess( int mod ) {
+        ps.printf("%-30s", "Access");
+        if ( Modifier.isStatic(mod) )
+            ps.print(" static");
+        if ( Modifier.isAbstract(mod) )
+            ps.print(" abstract");
+        if ( Modifier.isPublic(mod) )
+            ps.print(" public");
+        if ( Modifier.isFinal(mod) )
+            ps.print(" final");
+        if ( Modifier.isInterface(mod) )
+            ps.print(" interface");
+        if ( Modifier.isNative(mod) )
+            ps.print(" native");
+        if ( Modifier.isPrivate(mod) )
+            ps.print(" private");
+        if ( Modifier.isProtected(mod) )
+            ps.print(" protected");
+        if ( Modifier.isStrict(mod) )
+            ps.print(" strict");
+        if ( Modifier.isSynchronized(mod) )
+            ps.print(" synchronized");
+        if ( Modifier.isTransient(mod))
+            ps.print(" transient");
+        if ( Modifier.isVolatile(mod) )
+            ps.print(" volatile");
+        
+        ps.println();
+    }
+    
+    public static void main(String args[]) throws Exception {
+        if (args.length == 0) {
+            System.err.println("clsd <class file>+");
+        }
+        for (int i = 0; i < args.length; i++) {
+            File f = new File(args[i]);
+            if (!f.isFile())
+                System.err.println("File does not exist or is directory " + f);
+            else {
+                ClassDumper cd = new ClassDumper(args[i]);
+                cd.dump(null);
+            }
+        }
+    }
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clause.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,8 @@
+package aQute.libg.clauses;
+
+import java.util.*;
+
+public class Clause extends LinkedHashMap<String,String> {
+	private static final long	serialVersionUID	= 1L;
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Clauses.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,65 @@
+package aQute.libg.clauses;
+
+import java.util.*;
+
+import aQute.libg.log.*;
+import aQute.libg.qtokens.*;
+
+public class Clauses extends LinkedHashMap<String,Map<String,String>>{
+	private static final long	serialVersionUID	= 1L;
+	
+	/**
+	 * Standard OSGi header parser. This parser can handle the format clauses
+	 * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '='
+	 * value )
+	 * 
+	 * This is mapped to a Map { name => Map { attr|directive => value } }
+	 * 
+	 * @param value
+	 * @return
+	 * @throws MojoExecutionException
+	 */
+	static public Clauses parse(String value, Logger logger) {
+		if (value == null || value.trim().length() == 0)
+			return new Clauses();
+
+		Clauses result = new Clauses();
+		QuotedTokenizer qt = new QuotedTokenizer(value, ";=,");
+		char del;
+		do {
+			boolean hadAttribute = false;
+			Clause clause = new Clause();
+			List<String> aliases = new ArrayList<String>();
+			aliases.add(qt.nextToken());
+			del = qt.getSeparator();
+			while (del == ';') {
+				String adname = qt.nextToken();
+				if ((del = qt.getSeparator()) != '=') {
+					if (hadAttribute)
+						throw new IllegalArgumentException(
+								"Header contains name field after attribute or directive: "
+										+ adname + " from " + value);
+					aliases.add(adname);
+				} else {
+					String advalue = qt.nextToken();
+					clause.put(adname, advalue);
+					del = qt.getSeparator();
+					hadAttribute = true;
+				}
+			}
+			for (Iterator<String> i = aliases.iterator(); i.hasNext();) {
+				String packageName = (String) i.next();
+				if (result.containsKey(packageName)) {
+					if (logger != null)
+						logger
+								.warning("Duplicate package name in header: "
+										+ packageName
+										+ ". Multiple package names in one clause not supported in Bnd.");
+				} else
+					result.put(packageName, clause);
+			}
+		} while (del == ',');
+		return result;
+	}
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Instruction.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Instruction.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Selector.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Selector.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/clauses/Selector.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,129 @@
+/*
+ * $Header: /cvsroot/bnd/aQute.libg/src/aQute/libg/clauses/Selector.java,v 1.1 2009/01/19 14:17:42 pkriens Exp $
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package aQute.libg.clauses;
+
+import java.util.*;
+import java.util.regex.*;
+
+public class Selector {
+	Pattern	pattern;
+	String	instruction;
+	boolean	negated;
+	Clause	clause;
+
+	public Selector(String instruction, boolean negated) {
+		this.instruction = instruction;
+		this.negated = negated;
+	}
+
+	public boolean matches(String value) {
+		if (pattern == null) {
+			pattern = Pattern.compile(instruction);
+		}
+		Matcher m = pattern.matcher(value);
+		return m.matches();
+	}
+
+	public boolean isNegated() {
+		return negated;
+	}
+
+	public String getPattern() {
+		return instruction;
+	}
+
+	/**
+	 * Convert a string based pattern to a regular expression based pattern.
+	 * This is called an instruction, this object makes it easier to handle the
+	 * different cases
+	 * 
+	 * @param string
+	 * @return
+	 */
+	public static Selector getPattern(String string) {
+		boolean negated = false;
+		if (string.startsWith("!")) {
+			negated = true;
+			string = string.substring(1);
+		}
+		StringBuffer sb = new StringBuffer();
+		for (int c = 0; c < string.length(); c++) {
+			switch (string.charAt(c)) {
+			case '.':
+				sb.append("\\.");
+				break;
+			case '*':
+				sb.append(".*");
+				break;
+			case '?':
+				sb.append(".?");
+				break;
+			default:
+				sb.append(string.charAt(c));
+				break;
+			}
+		}
+		string = sb.toString();
+		if (string.endsWith("\\..*")) {
+			sb.append("|");
+			sb.append(string.substring(0, string.length() - 4));
+		}
+		return new Selector(sb.toString(), negated);
+	}
+
+	public String toString() {
+		return getPattern();
+	}
+
+	public Clause getClause() {
+		return clause;
+	}
+
+	public void setClause(Clause clause) {
+		this.clause = clause;
+	}
+
+	public static List<Selector> getInstructions(Clauses clauses) {
+		List<Selector> result = new ArrayList<Selector>();
+		for (Map.Entry<String, Map<String, String>> entry : clauses.entrySet()) {
+			Selector instruction = getPattern(entry.getKey());
+			result.add(instruction);
+		}
+		return result;
+	}
+	
+	public static <T> List<T> select(Collection<T> domain,
+			List<Selector> instructions) {
+		List<T> result = new ArrayList<T>();
+		Iterator<T> iterator = domain.iterator(); 
+		value: while (iterator.hasNext()) {
+			T value = iterator.next();
+			for (Selector instruction : instructions) {
+				if (instruction.matches(value.toString())) {
+					if (!instruction.isNegated())
+						result.add(value);
+					continue value;
+				}
+			}
+		}
+		return result;
+	}
+	
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/dumpzip/DumpZip.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/dumpzip/DumpZip.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/dumpzip/DumpZip.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,9 @@
+package aQute.libg.dumpzip;
+
+import java.io.*;
+
+public class DumpZip {
+    PrintStream out;
+    
+    
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/fileiterator/FileIterator.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/fileiterator/FileIterator.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/fileiterator/FileIterator.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,45 @@
+package aQute.libg.fileiterator;
+
+import java.io.*;
+import java.util.*;
+
+public class FileIterator implements Iterator<File> {
+    File         dir;
+    int          n = 0;
+    FileIterator next;
+
+    public FileIterator(File nxt) {
+        assert nxt.isDirectory();
+        this.dir = nxt;
+    }
+
+    public boolean hasNext() {
+        if (next != null)
+            return next.hasNext();
+        else
+            return n < dir.list().length;
+    }
+
+    public File next() {
+        if (next != null) {
+            File answer = next.next();
+            if (!next.hasNext())
+                next = null;
+            return answer;
+        } else {
+            File nxt = dir.listFiles()[n++];
+            if (nxt.isDirectory()) {
+                next = new FileIterator(nxt);
+                return nxt;
+            } else if (nxt.isFile()) {
+                return nxt;
+            } else
+                throw new IllegalStateException("File disappeared");
+        }
+    }
+
+    public void remove() {
+        throw new UnsupportedOperationException(
+                "Cannot remove from a file iterator");
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/generics/Create.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/generics/Create.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/generics/Create.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,40 @@
+package aQute.libg.generics;
+
+import java.util.*;
+
+public class Create {
+    
+    public static <K,V>  Map<K, V> map() {
+        return new LinkedHashMap<K,V>();
+    }
+
+    public static <T>  List<T> list() {
+        return new ArrayList<T>();
+    }
+
+    public static <T>  Set<T> set() {
+        return new HashSet<T>();
+    }
+
+    public static <T>  List<T> list(T[] source) {
+        return new ArrayList<T>(Arrays.asList(source));
+    }
+
+    public static <T>  Set<T> set(T[]source) {
+        return new HashSet<T>(Arrays.asList(source));
+    }
+
+    public static <K,V>  Map<K, V> copy(Map<K,V> source) {
+        return new LinkedHashMap<K,V>(source);
+    }
+
+    public static <T>  List<T> copy(List<T> source) {
+        return new ArrayList<T>(source);
+    }
+
+    public static <T>  Set<T> copy(Set<T> source) {
+        return new HashSet<T>(source);
+    }
+
+    
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/header/OSGiHeader.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/header/OSGiHeader.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/header/OSGiHeader.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,145 @@
+package aQute.libg.header;
+
+import java.util.*;
+
+import aQute.libg.generics.*;
+import aQute.libg.qtokens.*;
+import aQute.libg.reporter.*;
+
+public class OSGiHeader {
+
+    static public Map<String, Map<String, String>> parseHeader(String value) {
+        return parseHeader(value, null);
+    }
+
+    /**
+     * Standard OSGi header parser. This parser can handle the format clauses
+     * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '='
+     * value )
+     * 
+     * This is mapped to a Map { name => Map { attr|directive => value } }
+     * 
+     * @param value
+     *            A string
+     * @return a Map<String,Map<String,String>>
+     */
+    static public Map<String, Map<String, String>> parseHeader(String value,
+            Reporter logger) {
+        if (value == null || value.trim().length() == 0)
+            return Create.map();
+
+        Map<String, Map<String, String>> result = Create.map();
+        QuotedTokenizer qt = new QuotedTokenizer(value, ";=,");
+        char del = 0;
+        do {
+            boolean hadAttribute = false;
+            Map<String, String> clause = Create.map();
+            List<String> aliases = Create.list();
+            String name = qt.nextToken(",;");
+
+            del = qt.getSeparator();
+            if (name == null || name.length() == 0) {
+                if (logger != null && logger.isPedantic()) {
+                    logger
+                            .warning("Empty clause, usually caused by repeating a comma without any name field or by having spaces after the backslash of a property file: "
+                                    + value);
+                }
+                if (name == null)
+                    break;
+            } else {
+                name = name.trim();
+
+                aliases.add(name);
+                while (del == ';') {
+                    String adname = qt.nextToken();
+                    if ((del = qt.getSeparator()) != '=') {
+                        if (hadAttribute)
+                            if (logger != null) {
+                                logger
+                                        .error("Header contains name field after attribute or directive: "
+                                                + adname
+                                                + " from "
+                                                + value
+                                                + ". Name fields must be consecutive, separated by a ';' like a;b;c;x=3;y=4");
+                            }
+                        if (adname != null && adname.length() > 0)
+                            aliases.add(adname.trim());
+                    } else {
+                        String advalue = qt.nextToken();
+                        if (clause.containsKey(adname)) {
+                            if (logger != null && logger.isPedantic())
+                                logger
+                                        .warning("Duplicate attribute/directive name "
+                                                + adname
+                                                + " in "
+                                                + value
+                                                + ". This attribute/directive will be ignored");
+                        }
+                        if (advalue == null) {
+                            if (logger != null)
+                                logger
+                                        .error("No value after '=' sign for attribute "
+                                                + adname);
+                            advalue = "";
+                        }
+                        clause.put(adname.trim(), advalue.trim());
+                        del = qt.getSeparator();
+                        hadAttribute = true;
+                    }
+                }
+
+                // Check for duplicate names. The aliases list contains
+                // the list of nams, for each check if it exists. If so,
+                // add a number of "~" to make it unique.
+                for (String clauseName : aliases) {
+                    if (result.containsKey(clauseName)) {
+                        if (logger != null && logger.isPedantic())
+                            logger
+                                    .warning("Duplicate name "
+                                            + clauseName
+                                            + " used in header: '"
+                                            + clauseName
+                                            + "'. Duplicate names are specially marked in Bnd with a ~ at the end (which is stripped at printing time).");
+                        while (result.containsKey(clauseName))
+                            clauseName += "~";
+                    }
+                    result.put(clauseName, clause);
+                }
+            }
+        } while (del == ',');
+        return result;
+    }
+
+    public static Map<String, String> parseProperties(String input) {
+        return parseProperties(input, null);
+    }
+
+    public static Map<String, String> parseProperties(String input, Reporter logger) {
+        if (input == null || input.trim().length() == 0)
+            return Create.map();
+
+        Map<String, String> result = Create.map();
+        QuotedTokenizer qt = new QuotedTokenizer(input, "=,");
+        char del = ',';
+
+        while (del == ',') {
+            String key = qt.nextToken(",=");
+            String value = "";
+            del = qt.getSeparator();
+            if (del == '=') {
+                value = qt.nextToken(",=");
+                del = qt.getSeparator();
+            }
+            result.put(key, value);
+        }
+        if (del != 0)
+            if ( logger == null )
+            throw new IllegalArgumentException(
+                    "Invalid syntax for properties: " + input);
+            else
+                logger.error("Invalid syntax for properties: " + input);
+
+        return result;
+    }
+
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/log/Logger.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/log/Logger.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/log/Logger.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,16 @@
+package aQute.libg.log;
+
+import java.util.*;
+
+
+public interface Logger {
+	void error(String s, Object ... args);
+	void warning(String s, Object ... args);
+	void progress(String s, Object ... args);
+	
+	List<String> getWarnings();
+	List<String> getErrors();
+	List<String> getProgress();
+	
+	boolean isPedantic();
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/qtokens/QuotedTokenizer.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,118 @@
+package aQute.libg.qtokens;
+
+import java.util.*;
+
+import aQute.libg.generics.*;
+
+public class QuotedTokenizer {
+	String	string;
+	int		index				= 0;
+	String	separators;
+	boolean	returnTokens;
+	boolean	ignoreWhiteSpace	= true;
+	String	peek;
+	char	separator;
+
+	public QuotedTokenizer(String string, String separators, boolean returnTokens ) {
+		if ( string == null )
+			throw new IllegalArgumentException("string argument must be not null");
+		this.string = string;
+		this.separators = separators;
+		this.returnTokens = returnTokens;
+	}
+	public QuotedTokenizer(String string, String separators) {
+		this(string,separators,false);
+	}
+
+	public String nextToken(String separators) {
+		separator = 0;
+		if ( peek != null ) {
+			String tmp = peek;
+			peek = null;
+			return tmp;
+		}
+		
+		if ( index == string.length())
+			return null;
+		
+		StringBuffer sb = new StringBuffer();
+
+		while (index < string.length()) {
+			char c = string.charAt(index++);
+
+			if ( Character.isWhitespace(c)) {
+				if ( index == string.length())
+					break;
+				else {
+				    sb.append(c);
+					continue;
+				}
+			}
+			
+			if (separators.indexOf(c) >= 0) {
+				if (returnTokens)
+					peek = Character.toString(c);
+				else
+					separator = c;
+				break;
+			}
+
+			switch (c) {
+				case '"' :
+				case '\'' :
+					quotedString(sb, c);
+					break;
+
+				default :
+					sb.append(c);
+			}
+		}
+		String result = sb.toString().trim();
+		if ( result.length()==0 && index==string.length())
+			return null;
+		return result;
+	}
+
+	public String nextToken() {
+		return nextToken(separators);
+	}
+
+	private void quotedString(StringBuffer sb, char c) {
+		char quote = c;
+		while (index < string.length()) {
+			c = string.charAt(index++);
+			if (c == quote)
+				break;
+			if (c == '\\' && index < string.length()
+					&& string.charAt(index + 1) == quote)
+				c = string.charAt(index++);
+			sb.append(c);
+		}
+	}
+
+	public String[] getTokens() {
+		return getTokens(0);
+	}
+
+	private String [] getTokens(int cnt){
+		String token = nextToken();
+		if ( token == null ) 
+			return new String[cnt];
+		
+		String result[] = getTokens(cnt+1);
+		result[cnt]=token;
+		return result;
+	}
+
+	public char getSeparator() { return separator; }
+	
+	public List<String> getTokenSet() {
+		List<String> list = Create.list();
+		String token = nextToken();
+		while ( token != null ) {
+			list.add(token);
+			token = nextToken();
+		}
+		return list;
+	}
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/reporter/Reporter.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/reporter/Reporter.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/reporter/Reporter.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,15 @@
+package aQute.libg.reporter;
+
+import java.util.*;
+
+
+public interface Reporter {
+	void error(String s, Object ... args);
+	void warning(String s, Object ... args);
+	void progress(String s, Object ... args);
+	void trace(String s, Object ... args);
+	List<String> getWarnings();
+	List<String> getErrors();
+	
+	boolean isPedantic();
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Replacer.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Replacer.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Replacer.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,5 @@
+package aQute.libg.sed;
+
+public interface Replacer {
+    String process(String line);
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Sed.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Sed.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/sed/Sed.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,82 @@
+package aQute.libg.sed;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+public class Sed {
+    final File                 file;
+    final Replacer             macro;
+    File                       output;
+
+    final Map<Pattern, String> replacements = new LinkedHashMap<Pattern, String>();
+
+    public Sed(Replacer macro, File file) {
+        assert file.isFile();
+        this.file = file;
+        this.macro = macro;
+    }
+
+    public void setOutput(File f) {
+        output = f;
+    }
+
+    public void replace(String pattern, String replacement) {
+        replacements.put(Pattern.compile(pattern), replacement);
+    }
+
+    public void doIt() throws IOException {
+        BufferedReader brdr = new BufferedReader(new FileReader(file));
+        File out;
+        if (output != null)
+            out = output;
+        else
+            out = new File(file.getAbsolutePath() + ".tmp");
+        File bak = new File(file.getAbsolutePath() + ".bak");
+        PrintWriter pw = new PrintWriter(new FileWriter(out));
+        try {
+            String line;
+            while ((line = brdr.readLine()) != null) {
+                for (Pattern p : replacements.keySet()) {
+                    String replace = replacements.get(p);
+                    Matcher m = p.matcher(line);
+
+                    StringBuffer sb = new StringBuffer();
+                    while (m.find()) {
+                        String tmp = setReferences(m, replace);
+                        tmp = macro.process(tmp);
+                        m.appendReplacement(sb, Matcher.quoteReplacement(tmp));
+                    }
+                    m.appendTail(sb);
+
+                    line = sb.toString();
+                }
+                pw.println(line);
+            }
+            pw.close();
+            if (output == null) {
+                file.renameTo(bak);
+                out.renameTo(file);
+            }
+        } finally {
+            brdr.close();
+            pw.close();
+        }
+    }
+
+    private String setReferences(Matcher m, String replace) {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < replace.length(); i++) {
+            char c = replace.charAt(i);
+            if (c == '$' && i < replace.length() - 1
+                    && Character.isDigit(replace.charAt(i + 1))) {
+                int n = replace.charAt(i + 1) - '0';
+                if ( n <= m.groupCount() )
+                    sb.append(m.group(n));
+                i++;
+            } else
+                sb.append(c);
+        }
+        return sb.toString();
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/Version.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/Version.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/Version.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,148 @@
+package aQute.libg.version;
+
+import java.util.regex.*;
+
+public class Version implements Comparable<Version> {
+    final int                   major;
+    final int                   minor;
+    final int                   micro;
+    final String                qualifier;
+    public final static String  VERSION_STRING = "(\\d+)(\\.(\\d+)(\\.(\\d+)(\\.([-_\\da-zA-Z]+))?)?)?";
+    public final static Pattern VERSION        = Pattern
+                                                       .compile(VERSION_STRING);
+    public final static Version LOWEST         = new Version();
+    public final static Version HIGHEST        = new Version(Integer.MAX_VALUE,
+                                                       Integer.MAX_VALUE,
+                                                       Integer.MAX_VALUE,
+                                                       "\uFFFF");
+
+    public Version() {
+        this(0);
+    }
+
+    public Version(int major, int minor, int micro, String qualifier) {
+        this.major = major;
+        this.minor = minor;
+        this.micro = micro;
+        this.qualifier = qualifier;
+    }
+
+    public Version(int major, int minor, int micro) {
+        this(major, minor, micro, null);
+    }
+
+    public Version(int major, int minor) {
+        this(major, minor, 0, null);
+    }
+
+    public Version(int major) {
+        this(major, 0, 0, null);
+    }
+
+    public Version(String version) {
+        Matcher m = VERSION.matcher(version);
+        if (!m.matches())
+            throw new IllegalArgumentException("Invalid syntax for version: "
+                    + version);
+
+        major = Integer.parseInt(m.group(1));
+        if (m.group(3) != null)
+            minor = Integer.parseInt(m.group(3));
+        else
+            minor = 0;
+
+        if (m.group(5) != null)
+            micro = Integer.parseInt(m.group(5));
+        else
+            micro = 0;
+
+        qualifier = m.group(7);
+    }
+
+    public int getMajor() {
+        return major;
+    }
+
+    public int getMinor() {
+        return minor;
+    }
+
+    public int getMicro() {
+        return micro;
+    }
+
+    public String getQualifier() {
+        return qualifier;
+    }
+
+    public int compareTo(Version other) {
+        if (other == this)
+            return 0;
+
+        if (!(other instanceof Version))
+            throw new IllegalArgumentException(
+                    "Can only compare versions to versions");
+
+        Version o = (Version) other;
+        if (major != o.major)
+            return major - o.major;
+
+        if (minor != o.minor)
+            return minor - o.minor;
+
+        if (micro != o.micro)
+            return micro - o.micro;
+
+        int c = 0;
+        if (qualifier != null)
+            c = 1;
+        if (o.qualifier != null)
+            c += 2;
+
+        switch (c) {
+        case 0:
+            return 0;
+        case 1:
+            return 1;
+        case 2:
+            return -1;
+        }
+        return qualifier.compareTo(o.qualifier);
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer();
+        sb.append(major);
+        sb.append(".");
+        sb.append(minor);
+        sb.append(".");
+        sb.append(micro);
+        if (qualifier != null) {
+            sb.append(".");
+            sb.append(qualifier);
+        }
+        return sb.toString();
+    }
+
+    public boolean equals(Object ot) {
+        if ( ! (ot instanceof Version))
+            return false;
+        
+        return compareTo((Version)ot) == 0;
+    }
+
+    public int hashCode() {
+        return major * 97 ^ minor * 13 ^ micro
+                + (qualifier == null ? 97 : qualifier.hashCode());
+    }
+
+    public int get(int i) {
+        switch(i) {
+        case 0 : return major;
+        case 1 : return minor;
+        case 2 : return micro;
+        default:
+            throw new IllegalArgumentException("Version can only get 0 (major), 1 (minor), or 2 (micro)");
+        }
+    }
+}

Added: projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/VersionRange.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/VersionRange.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/libg/src/main/java/aQute/libg/version/VersionRange.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,85 @@
+package aQute.libg.version;
+
+import java.util.regex.*;
+
+public class VersionRange {
+	Version			high;
+	Version			low;
+	char			start	= '[';
+	char			end		= ']';
+
+	static Pattern	RANGE	= Pattern.compile("(\\(|\\[)\\s*(" +
+									Version.VERSION_STRING + ")\\s*,\\s*(" +
+									Version.VERSION_STRING + ")\\s*(\\)|\\])");
+
+	public VersionRange(String string) {
+		string = string.trim();
+		Matcher m = RANGE.matcher(string);
+		if (m.matches()) {
+			start = m.group(1).charAt(0);
+			String v1 = m.group(2);
+			String v2 = m.group(10);
+			low = new Version(v1);
+			high = new Version(v2);
+			end = m.group(18).charAt(0);
+			if (low.compareTo(high) > 0)
+				throw new IllegalArgumentException(
+						"Low Range is higher than High Range: " + low + "-" +
+								high);
+
+		} else
+			high = low = new Version(string);
+	}
+
+	public boolean isRange() {
+		return high != low;
+	}
+
+	public boolean includeLow() {
+		return start == '[';
+	}
+
+	public boolean includeHigh() {
+		return end == ']';
+	}
+
+	public String toString() {
+		if (high == low)
+			return high.toString();
+
+		StringBuffer sb = new StringBuffer();
+		sb.append(start);
+		sb.append(low);
+		sb.append(',');
+		sb.append(high);
+		sb.append(end);
+		return sb.toString();
+	}
+
+	public Version getLow() {
+		return low;
+	}
+
+	public Version getHigh() {
+		return high;
+	}
+
+	public boolean includes(Version v) {
+		if ( !isRange() ) {
+			return low.compareTo(v) <=0;
+		}
+		if (includeLow()) {
+			if (v.compareTo(low) < 0)
+				return false;
+		} else if (v.compareTo(low) <= 0)
+			return false;
+
+		if (includeHigh()) {
+			if (v.compareTo(high) > 0)
+				return false;
+		} else if (v.compareTo(high) >= 0)
+			return false;
+		
+		return true;
+	}
+}
\ No newline at end of file

Modified: projects/jboss-osgi/projects/aQute/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/pom.xml	2009-09-29 06:38:51 UTC (rev 94086)
+++ projects/jboss-osgi/projects/aQute/trunk/pom.xml	2009-09-29 06:52:33 UTC (rev 94087)
@@ -32,6 +32,8 @@
   <!-- Modules -->
   <modules>
     <module>runtime</module>
+    <module>libg</module>
+    <module>service</module>
     <module>bnd</module>
   </modules>
 

Added: projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/default.perm
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/default.perm	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/default.perm	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,12 @@
+# Lines beginning with '#' or '//' are comments
+#
+# This file contains the default permissions
+# for the PermssionAdmin. The SimplePermissionPolicy bundle
+# will set the default permissions to the permissions
+# listed here if the default permissions have not alreay been set
+# The permissions are listed one per
+# line in PermissionInfo encoded format.
+# See org.osgi.service.permissionadmin.PermissionInfo
+
+(java.security.AllPermission)
+

Added: projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/permissions.perm
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/permissions.perm	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/runtime/src/main/java/aQute/junit/runtime/permissions.perm	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,10 @@
+# Lines beginning with '#' or '//' are comments
+#
+# This file contains the permissions to be granted
+# to this bundle.
+# The permissions are listed one per
+# line in PermissionInfo encoded format.
+# See org.osgi.service.permissionadmin.PermissionInfo
+
+(java.security.AllPermission)
+

Added: projects/jboss-osgi/projects/aQute/trunk/service/.classpath
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/.classpath	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/.classpath	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: projects/jboss-osgi/projects/aQute/trunk/service/.project
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/.project	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/.project	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>service</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.eclipse.jdt.core.prefs	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,5 @@
+#Tue Sep 29 07:53:53 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/.settings/org.maven.ide.eclipse.prefs	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,9 @@
+#Tue Sep 29 07:53:52 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: projects/jboss-osgi/projects/aQute/trunk/service/pom.xml
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/pom.xml	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+  <!-- ====================================================================== -->
+  <!--                                                                        -->
+  <!--  JBoss, the OpenSource J2EE webOS                                      -->
+  <!--                                                                        -->
+  <!--  Distributable under LGPL license.                                     -->
+  <!--  See terms of license at http://www.gnu.org.                           -->
+  <!--                                                                        -->
+  <!-- ====================================================================== -->
+
+  <!-- $Id: pom.xml 93592 2009-09-16 09:00:08Z thomas.diesler at jboss.com $
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>aQute - Service</name>
+
+  <groupId>biz.aQute</groupId>
+  <artifactId>service</artifactId>
+  <packaging>jar</packaging>
+
+  <!-- Parent -->
+  <parent>
+    <groupId>biz.aQute</groupId>
+    <artifactId>parent</artifactId>
+    <version>0.0.356-SNAPSHOT</version>
+  </parent>
+
+  <!-- Dependencies -->
+  <dependencies>
+  </dependencies>
+
+</project>

Added: projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/Scripter.java
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/Scripter.java	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/Scripter.java	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1,10 @@
+package aQute.service.scripting;
+
+import java.io.*;
+import java.util.*;
+
+public interface Scripter {
+    String MIME_TYPE = "mime.type";
+    
+    Object eval(Map<String,Object> context, Reader reader ) throws Exception;
+}

Added: projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/packageinfo
===================================================================
--- projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/packageinfo	                        (rev 0)
+++ projects/jboss-osgi/projects/aQute/trunk/service/src/main/java/aQute/service/scripting/packageinfo	2009-09-29 06:52:33 UTC (rev 94087)
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file



More information about the jboss-osgi-commits mailing list