Merge remote branch 'origin'

Conflicts:
	core/src/main/resources/rest.properties
	demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java
	rimuhosting/pom.xml
diff --git a/assemblies/src/main/resources/assemblies/package-descriptor.xml b/assemblies/src/main/resources/assemblies/package-descriptor.xml
index f919a7d..b27ad79 100644
--- a/assemblies/src/main/resources/assemblies/package-descriptor.xml
+++ b/assemblies/src/main/resources/assemblies/package-descriptor.xml
@@ -1,666 +1,666 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-

-

-    Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>

-

-    ====================================================================

-    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.

-    ====================================================================

-

--->

-<assembly>

-    <id>package</id>

-    <formats>

-        <format>zip</format>

-    </formats>

-    <!-- 

-      LICENSE.txt

-      README.txt

-      core

-         + docs <- javadoc for core, blobstore, and compute

-         + lib <- core, blobstore, and compute jars and dependencies for core

-         + src <- expanded or source jar for core, blobstore, and compute

-      profiles

-         + enterprise

-            + README.txt <- how to use the profile

-            + lib <- not core

-            + docs <- not core

-            + src <- not core

-      extensions

-         + log4j

-            + README.txt <- how to use the extension

-            + lib <- not core

-            + docs <- not core

-            + src <- not core

-      providers

-         + rackspace

-            + README.txt <- status of this provider (what is implemented/not implemented) 

-            + lib <- not core

-            + docs <- not core

-            + src <- not core

-      tools <- integrations with other tools

-         + antcontrib

-            + README.txt <- how to use the tool

-            + lib <- not core

-            + docs <- not core

-            + src <- not core

-      samples <- includes samples and demos

-         + tweetstore

-            + README.txt <- how to build and run the sample

-            + src <- just demo

-        

-      see http://code.google.com/p/jclouds/issues/detail?id=127

-    -->

-    <fileSets>

-        <!-- "loose" files -->

-        <fileSet>

-            <directory />

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <filtered>true</filtered>

-        </fileSet>

-        <fileSet>

-            <directory>project</directory>

-            <includes>

-                <include>LICENSE.txt</include>

-            </includes>

-            <filtered>true</filtered>

-        </fileSet>    

-          

-        <!-- core -->

-        <fileSet>

-            <directory>core/target</directory>

-            <includes>

-                <include>jclouds-core-${project.version}-jar-with-dependencies.jar</include>

-            </includes>

-            <outputDirectory>core/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>blobstore/target</directory>

-            <includes>

-                <include>jclouds-blobstore-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>core/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>compute/target</directory>

-            <includes>

-                <include>jclouds-compute-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>core/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>core/target</directory>

-            <includes>

-                <include>jclouds-core-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>core/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>blobstore/target</directory>

-            <includes>

-                <include>jclouds-blobstore-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>core/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>compute/target</directory>

-            <includes>

-                <include>jclouds-compute-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>core/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>core/target/apidocs</directory>

-            <outputDirectory>core/docs</outputDirectory>            

-        </fileSet>    

-        <fileSet>

-            <directory>blobstore/target/apidocs</directory>

-            <outputDirectory>core/docs</outputDirectory>            

-        </fileSet>    

-        <fileSet>

-            <directory>compute/target/apidocs</directory>

-            <outputDirectory>core/docs</outputDirectory>            

-        </fileSet>    

-        

-        <!-- providers: atmos -->

-        <fileSet>

-            <directory>atmos/target</directory>

-            <includes>

-                <include>jclouds-atmos-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/atmos/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>atmos/target</directory>

-            <includes>

-                <include>jclouds-atmos-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/atmos/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>atmos/target/apidocs</directory>

-            <outputDirectory>providers/atmos/docs</outputDirectory>            

-        </fileSet>   

-        <fileSet>

-            <directory>atmos</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/atmos</outputDirectory>            

-        </fileSet>              

-         

-        <!-- providers: aws -->

-        <fileSet>

-            <directory>aws/core/target</directory>

-            <includes>

-                <include>jclouds-aws-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/aws/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>aws/core/target</directory>

-            <includes>

-                <include>jclouds-aws-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/aws/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>aws/core/target/apidocs</directory>

-            <outputDirectory>providers/aws/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>aws/core</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/aws</outputDirectory>            

-        </fileSet>         

- 

-        <!-- providers: azure -->

-        <fileSet>

-            <directory>azure/target</directory>

-            <includes>

-                <include>jclouds-azure-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/azure/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>azure/target</directory>

-            <includes>

-                <include>jclouds-azure-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/azure/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>azure/target/apidocs</directory>

-            <outputDirectory>providers/azure/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>azure</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/azure</outputDirectory>            

-        </fileSet>

-        

-        <!-- providers: slicehost -->

-        <fileSet>

-            <directory>slicehost/target</directory>

-            <includes>

-                <include>jclouds-slicehost-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/slicehost/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>slicehost/target</directory>

-            <includes>

-                <include>jclouds-slicehost-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/slicehost/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>slicehost/target/apidocs</directory>

-            <outputDirectory>providers/slicehost/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>slicehost</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/slicehost</outputDirectory>            

-        </fileSet> 

-        

-        <!-- providers: rackspace -->

-        <fileSet>

-            <directory>rackspace/target</directory>

-            <includes>

-                <include>jclouds-rackspace-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/rackspace/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>rackspace/target</directory>

-            <includes>

-                <include>jclouds-rackspace-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/rackspace/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>rackspace/target/apidocs</directory>

-            <outputDirectory>providers/rackspace/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>rackspace</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/rackspace</outputDirectory>            

-        </fileSet> 

-        

-        <!-- providers: gogrid -->

-        <fileSet>

-            <directory>gogrid/target</directory>

-            <includes>

-                <include>jclouds-gogrid-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/gogrid/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>gogrid/target</directory>

-            <includes>

-                <include>jclouds-gogrid-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/gogrid/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>gogrid/target/apidocs</directory>

-            <outputDirectory>providers/gogrid/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>gogrid</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/gogrid</outputDirectory>            

-        </fileSet> 

-        

-        <!-- providers: rimuhosting -->

-        <fileSet>

-            <directory>rimuhosting/target</directory>

-            <includes>

-                <include>jclouds-rimuhosting-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/rimuhosting/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>rimuhosting/target</directory>

-            <includes>

-                <include>jclouds-rimuhosting-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/rimuhosting/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>rimuhosting/target/apidocs</directory>

-            <outputDirectory>providers/rimuhosting/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>rimuhosting</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/rimuhosting</outputDirectory>            

-        </fileSet> 

-        

-        <!-- providers: bluelock -->

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/vcloud/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/vcloud/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/vcloud/target/apidocs</directory>

-            <outputDirectory>providers/vcloud/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/core</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/vcloud</outputDirectory>            

-        </fileSet>     

-        

-        <!-- providers: bluelock -->

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/bluelock/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/bluelock/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/bluelock/target</directory>

-            <includes>

-                <include>jclouds-bluelock-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/bluelock/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/bluelock/target</directory>

-            <includes>

-                <include>jclouds-bluelock-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/bluelock/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/bluelock/target/apidocs</directory>

-            <outputDirectory>providers/bluelock/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/bluelock</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/bluelock</outputDirectory>            

-        </fileSet>     

-        

-        <!-- providers: terremark -->

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/terremark/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/core/target</directory>

-            <includes>

-                <include>jclouds-vcloud-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/terremark/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/terremark/target</directory>

-            <includes>

-                <include>jclouds-terremark-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>providers/terremark/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/terremark/target</directory>

-            <includes>

-                <include>jclouds-terremark-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>providers/terremark/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/terremark/target/apidocs</directory>

-            <outputDirectory>providers/terremark/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>vcloud/terremark</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>providers/terremark</outputDirectory>            

-        </fileSet>     

-        

-        <!-- extensions: bouncycastle -->

-        <fileSet>

-            <directory>extensions/bouncycastle/target</directory>

-            <includes>

-                <include>jclouds-bouncycastle-${project.version}-jar-with-dependencies.jar</include>

-            </includes>

-            <outputDirectory>extensions/bouncycastle/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/bouncycastle/target</directory>

-            <includes>

-                <include>jclouds-bouncycastle-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/bouncycastle/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/bouncycastle/target/apidocs</directory>

-            <outputDirectory>extensions/bouncycastle/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/bouncycastle</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/bouncycastle</outputDirectory>            

-        </fileSet>

-                

-        <!-- extensions: enterprise -->

-        <fileSet>

-            <directory>extensions/enterprise/target</directory>

-            <includes>

-                <include>jclouds-enterprise-${project.version}-jar-with-dependencies.jar</include>

-            </includes>

-            <outputDirectory>extensions/enterprise/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/enterprise/target</directory>

-            <includes>

-                <include>jclouds-enterprise-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/enterprise/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/enterprise/target/apidocs</directory>

-            <outputDirectory>extensions/enterprise/docs</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/enterprise</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/enterprise</outputDirectory>

-        </fileSet>

-

-        <!-- extensions: gae -->

-        <fileSet>

-            <directory>extensions/gae/target</directory>

-            <includes>

-                <include>jclouds-gae-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>extensions/gae/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/gae/target</directory>

-            <includes>

-                <include>jclouds-gae-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/gae/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/gae/target/apidocs</directory>

-            <outputDirectory>extensions/gae/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/gae</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/gae</outputDirectory>            

-        </fileSet>

-

-        <!-- extensions: joda -->

-        <fileSet>

-            <directory>extensions/joda/target</directory>

-            <includes>

-                <include>jclouds-joda-${project.version}-jar-with-dependencies.jar</include>

-            </includes>

-            <outputDirectory>extensions/joda/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/joda/target</directory>

-            <includes>

-                <include>jclouds-joda-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/joda/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/joda/target/apidocs</directory>

-            <outputDirectory>extensions/joda/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/joda</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/joda</outputDirectory>            

-        </fileSet>

-

-        <!-- extensions: apachehc -->

-        <fileSet>

-            <directory>extensions/apachehc/target</directory>

-            <includes>

-                <include>jclouds-apachehc-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>extensions/apachehc/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/apachehc/target</directory>

-            <includes>

-                <include>jclouds-apachehc-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/apachehc/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/apachehc/target/apidocs</directory>

-            <outputDirectory>extensions/apachehc/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/apachehc</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/apachehc</outputDirectory>            

-        </fileSet>

-        

-        <!-- extensions: jsch -->

-        <fileSet>

-            <directory>extensions/ssh/jsch/target</directory>

-            <includes>

-                <include>jclouds-jsch-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>extensions/jsch/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/ssh/jsch/target</directory>

-            <includes>

-                <include>jclouds-jsch-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/jsch/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/ssh/jsch/target/apidocs</directory>

-            <outputDirectory>extensions/jsch/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/ssh/jsch</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/jsch</outputDirectory>            

-        </fileSet>

-        

-        <!-- extensions: log4j -->

-        <fileSet>

-            <directory>extensions/log4j/target</directory>

-            <includes>

-                <include>jclouds-log4j-${project.version}.jar</include>

-            </includes>

-            <outputDirectory>extensions/log4j/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/log4j/target</directory>

-            <includes>

-                <include>jclouds-log4j-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>extensions/log4j/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>extensions/log4j/target/apidocs</directory>

-            <outputDirectory>extensions/log4j/docs</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>extensions/log4j</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>extensions/log4j</outputDirectory>            

-        </fileSet>

-

-        <!-- tools: antcontrib -->

-        <fileSet>

-            <directory>tools/antcontrib/target</directory>

-            <includes>

-                <include>jclouds-antcontrib-${project.version}-jar-with-dependencies.jar</include>

-            </includes>

-            <outputDirectory>tools/antcontrib/lib</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>tools/antcontrib/target</directory>

-            <includes>

-                <include>jclouds-antcontrib-${project.version}-sources.jar</include>

-            </includes>

-            <outputDirectory>tools/antcontrib/src</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>tools/antcontrib/target/apidocs</directory>

-            <outputDirectory>tools/antcontrib/docs</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>tools/antcontrib</directory>

-            <includes>

-                <include>README.txt</include>

-            </includes>

-            <outputDirectory>tools/antcontrib</outputDirectory>

-        </fileSet>

-        

-        <!-- samples -->

-        <fileSet>

-            <directory>demos/gae-tweetstore/target/jclouds-demo-gae-tweetstore</directory>

-            <outputDirectory>samples/gae-tweetstore</outputDirectory>            

-        </fileSet>

-        <fileSet>

-            <directory>aws/demos/createandlistbuckets/target/jclouds-aws-demo-createandlistbuckets-src</directory>

-            <outputDirectory>samples/aws/createandlistbuckes</outputDirectory>

-        </fileSet>

-        <fileSet>

-            <directory>aws/demos/googleappengine/target/jclouds-aws-demo-googleappengine-src</directory>

-            <outputDirectory>samples/aws/googleappengine</outputDirectory>

-        </fileSet>                

-    </fileSets>

-</assembly>

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+    Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
+
+    ====================================================================
+    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.
+    ====================================================================
+
+-->
+<assembly>
+    <id>package</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <!-- 
+      LICENSE.txt
+      README.txt
+      core
+         + docs <- javadoc for core, blobstore, and compute
+         + lib <- core, blobstore, and compute jars and dependencies for core
+         + src <- expanded or source jar for core, blobstore, and compute
+      profiles
+         + enterprise
+            + README.txt <- how to use the profile
+            + lib <- not core
+            + docs <- not core
+            + src <- not core
+      extensions
+         + log4j
+            + README.txt <- how to use the extension
+            + lib <- not core
+            + docs <- not core
+            + src <- not core
+      providers
+         + rackspace
+            + README.txt <- status of this provider (what is implemented/not implemented) 
+            + lib <- not core
+            + docs <- not core
+            + src <- not core
+      tools <- integrations with other tools
+         + antcontrib
+            + README.txt <- how to use the tool
+            + lib <- not core
+            + docs <- not core
+            + src <- not core
+      samples <- includes samples and demos
+         + tweetstore
+            + README.txt <- how to build and run the sample
+            + src <- just demo
+        
+      see http://code.google.com/p/jclouds/issues/detail?id=127
+    -->
+    <fileSets>
+        <!-- "loose" files -->
+        <fileSet>
+            <directory />
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <filtered>true</filtered>
+        </fileSet>
+        <fileSet>
+            <directory>project</directory>
+            <includes>
+                <include>LICENSE.txt</include>
+            </includes>
+            <filtered>true</filtered>
+        </fileSet>    
+          
+        <!-- core -->
+        <fileSet>
+            <directory>core/target</directory>
+            <includes>
+                <include>jclouds-core-${project.version}-jar-with-dependencies.jar</include>
+            </includes>
+            <outputDirectory>core/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>blobstore/target</directory>
+            <includes>
+                <include>jclouds-blobstore-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>core/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>compute/target</directory>
+            <includes>
+                <include>jclouds-compute-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>core/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>core/target</directory>
+            <includes>
+                <include>jclouds-core-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>core/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>blobstore/target</directory>
+            <includes>
+                <include>jclouds-blobstore-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>core/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>compute/target</directory>
+            <includes>
+                <include>jclouds-compute-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>core/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>core/target/apidocs</directory>
+            <outputDirectory>core/docs</outputDirectory>            
+        </fileSet>    
+        <fileSet>
+            <directory>blobstore/target/apidocs</directory>
+            <outputDirectory>core/docs</outputDirectory>            
+        </fileSet>    
+        <fileSet>
+            <directory>compute/target/apidocs</directory>
+            <outputDirectory>core/docs</outputDirectory>            
+        </fileSet>    
+        
+        <!-- providers: atmos -->
+        <fileSet>
+            <directory>atmos/target</directory>
+            <includes>
+                <include>jclouds-atmos-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/atmos/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>atmos/target</directory>
+            <includes>
+                <include>jclouds-atmos-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/atmos/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>atmos/target/apidocs</directory>
+            <outputDirectory>providers/atmos/docs</outputDirectory>            
+        </fileSet>   
+        <fileSet>
+            <directory>atmos</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/atmos</outputDirectory>            
+        </fileSet>              
+         
+        <!-- providers: aws -->
+        <fileSet>
+            <directory>aws/core/target</directory>
+            <includes>
+                <include>jclouds-aws-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/aws/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>aws/core/target</directory>
+            <includes>
+                <include>jclouds-aws-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/aws/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>aws/core/target/apidocs</directory>
+            <outputDirectory>providers/aws/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>aws/core</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/aws</outputDirectory>            
+        </fileSet>         
+ 
+        <!-- providers: azure -->
+        <fileSet>
+            <directory>azure/target</directory>
+            <includes>
+                <include>jclouds-azure-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/azure/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>azure/target</directory>
+            <includes>
+                <include>jclouds-azure-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/azure/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>azure/target/apidocs</directory>
+            <outputDirectory>providers/azure/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>azure</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/azure</outputDirectory>            
+        </fileSet>
+        
+        <!-- providers: slicehost -->
+        <fileSet>
+            <directory>slicehost/target</directory>
+            <includes>
+                <include>jclouds-slicehost-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/slicehost/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>slicehost/target</directory>
+            <includes>
+                <include>jclouds-slicehost-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/slicehost/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>slicehost/target/apidocs</directory>
+            <outputDirectory>providers/slicehost/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>slicehost</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/slicehost</outputDirectory>            
+        </fileSet> 
+        
+        <!-- providers: rackspace -->
+        <fileSet>
+            <directory>rackspace/target</directory>
+            <includes>
+                <include>jclouds-rackspace-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/rackspace/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>rackspace/target</directory>
+            <includes>
+                <include>jclouds-rackspace-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/rackspace/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>rackspace/target/apidocs</directory>
+            <outputDirectory>providers/rackspace/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>rackspace</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/rackspace</outputDirectory>            
+        </fileSet> 
+        
+        <!-- providers: gogrid -->
+        <fileSet>
+            <directory>gogrid/target</directory>
+            <includes>
+                <include>jclouds-gogrid-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/gogrid/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>gogrid/target</directory>
+            <includes>
+                <include>jclouds-gogrid-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/gogrid/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>gogrid/target/apidocs</directory>
+            <outputDirectory>providers/gogrid/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>gogrid</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/gogrid</outputDirectory>            
+        </fileSet> 
+        
+        <!-- providers: rimuhosting -->
+        <fileSet>
+            <directory>rimuhosting/target</directory>
+            <includes>
+                <include>jclouds-rimuhosting-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/rimuhosting/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>rimuhosting/target</directory>
+            <includes>
+                <include>jclouds-rimuhosting-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/rimuhosting/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>rimuhosting/target/apidocs</directory>
+            <outputDirectory>providers/rimuhosting/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>rimuhosting</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/rimuhosting</outputDirectory>            
+        </fileSet> 
+        
+        <!-- providers: bluelock -->
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/vcloud/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/vcloud/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/vcloud/target/apidocs</directory>
+            <outputDirectory>providers/vcloud/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/core</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/vcloud</outputDirectory>            
+        </fileSet>     
+        
+        <!-- providers: bluelock -->
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/bluelock/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/bluelock/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/bluelock/target</directory>
+            <includes>
+                <include>jclouds-bluelock-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/bluelock/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/bluelock/target</directory>
+            <includes>
+                <include>jclouds-bluelock-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/bluelock/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/bluelock/target/apidocs</directory>
+            <outputDirectory>providers/bluelock/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/bluelock</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/bluelock</outputDirectory>            
+        </fileSet>     
+        
+        <!-- providers: terremark -->
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/terremark/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/core/target</directory>
+            <includes>
+                <include>jclouds-vcloud-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/terremark/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/terremark/target</directory>
+            <includes>
+                <include>jclouds-terremark-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>providers/terremark/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/terremark/target</directory>
+            <includes>
+                <include>jclouds-terremark-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>providers/terremark/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/terremark/target/apidocs</directory>
+            <outputDirectory>providers/terremark/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>vcloud/terremark</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>providers/terremark</outputDirectory>            
+        </fileSet>     
+        
+        <!-- extensions: bouncycastle -->
+        <fileSet>
+            <directory>extensions/bouncycastle/target</directory>
+            <includes>
+                <include>jclouds-bouncycastle-${project.version}-jar-with-dependencies.jar</include>
+            </includes>
+            <outputDirectory>extensions/bouncycastle/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/bouncycastle/target</directory>
+            <includes>
+                <include>jclouds-bouncycastle-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/bouncycastle/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/bouncycastle/target/apidocs</directory>
+            <outputDirectory>extensions/bouncycastle/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/bouncycastle</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/bouncycastle</outputDirectory>            
+        </fileSet>
+                
+        <!-- extensions: enterprise -->
+        <fileSet>
+            <directory>extensions/enterprise/target</directory>
+            <includes>
+                <include>jclouds-enterprise-${project.version}-jar-with-dependencies.jar</include>
+            </includes>
+            <outputDirectory>extensions/enterprise/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/enterprise/target</directory>
+            <includes>
+                <include>jclouds-enterprise-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/enterprise/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/enterprise/target/apidocs</directory>
+            <outputDirectory>extensions/enterprise/docs</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/enterprise</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/enterprise</outputDirectory>
+        </fileSet>
+
+        <!-- extensions: gae -->
+        <fileSet>
+            <directory>extensions/gae/target</directory>
+            <includes>
+                <include>jclouds-gae-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>extensions/gae/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/gae/target</directory>
+            <includes>
+                <include>jclouds-gae-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/gae/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/gae/target/apidocs</directory>
+            <outputDirectory>extensions/gae/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/gae</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/gae</outputDirectory>            
+        </fileSet>
+
+        <!-- extensions: joda -->
+        <fileSet>
+            <directory>extensions/joda/target</directory>
+            <includes>
+                <include>jclouds-joda-${project.version}-jar-with-dependencies.jar</include>
+            </includes>
+            <outputDirectory>extensions/joda/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/joda/target</directory>
+            <includes>
+                <include>jclouds-joda-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/joda/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/joda/target/apidocs</directory>
+            <outputDirectory>extensions/joda/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/joda</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/joda</outputDirectory>            
+        </fileSet>
+
+        <!-- extensions: apachehc -->
+        <fileSet>
+            <directory>extensions/apachehc/target</directory>
+            <includes>
+                <include>jclouds-apachehc-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>extensions/apachehc/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/apachehc/target</directory>
+            <includes>
+                <include>jclouds-apachehc-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/apachehc/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/apachehc/target/apidocs</directory>
+            <outputDirectory>extensions/apachehc/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/apachehc</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/apachehc</outputDirectory>            
+        </fileSet>
+        
+        <!-- extensions: jsch -->
+        <fileSet>
+            <directory>extensions/ssh/jsch/target</directory>
+            <includes>
+                <include>jclouds-jsch-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>extensions/jsch/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/ssh/jsch/target</directory>
+            <includes>
+                <include>jclouds-jsch-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/jsch/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/ssh/jsch/target/apidocs</directory>
+            <outputDirectory>extensions/jsch/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/ssh/jsch</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/jsch</outputDirectory>            
+        </fileSet>
+        
+        <!-- extensions: log4j -->
+        <fileSet>
+            <directory>extensions/log4j/target</directory>
+            <includes>
+                <include>jclouds-log4j-${project.version}.jar</include>
+            </includes>
+            <outputDirectory>extensions/log4j/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/log4j/target</directory>
+            <includes>
+                <include>jclouds-log4j-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>extensions/log4j/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>extensions/log4j/target/apidocs</directory>
+            <outputDirectory>extensions/log4j/docs</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>extensions/log4j</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>extensions/log4j</outputDirectory>            
+        </fileSet>
+
+        <!-- tools: antcontrib -->
+        <fileSet>
+            <directory>tools/antcontrib/target</directory>
+            <includes>
+                <include>jclouds-antcontrib-${project.version}-jar-with-dependencies.jar</include>
+            </includes>
+            <outputDirectory>tools/antcontrib/lib</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>tools/antcontrib/target</directory>
+            <includes>
+                <include>jclouds-antcontrib-${project.version}-sources.jar</include>
+            </includes>
+            <outputDirectory>tools/antcontrib/src</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>tools/antcontrib/target/apidocs</directory>
+            <outputDirectory>tools/antcontrib/docs</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>tools/antcontrib</directory>
+            <includes>
+                <include>README.txt</include>
+            </includes>
+            <outputDirectory>tools/antcontrib</outputDirectory>
+        </fileSet>
+        
+        <!-- samples -->
+        <fileSet>
+            <directory>demos/gae-tweetstore/target/jclouds-demo-gae-tweetstore</directory>
+            <outputDirectory>samples/gae-tweetstore</outputDirectory>            
+        </fileSet>
+        <fileSet>
+            <directory>aws/demos/createandlistbuckets/target/jclouds-aws-demo-createandlistbuckets-src</directory>
+            <outputDirectory>samples/aws/createandlistbuckes</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>aws/demos/googleappengine/target/jclouds-aws-demo-googleappengine-src</directory>
+            <outputDirectory>samples/aws/googleappengine</outputDirectory>
+        </fileSet>                
+    </fileSets>
+</assembly>
diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties
index 7fb01d3..9108d8a 100644
--- a/core/src/main/resources/rest.properties
+++ b/core/src/main/resources/rest.properties
@@ -1,127 +1,126 @@
-#

-#

-# Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>

-#

-# ====================================================================

-# 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.

-# ====================================================================

-#

-azurequeue.contextbuilder=org.jclouds.azure.storage.AzureStorageContextBuilder

-azurequeue.sync=org.jclouds.azure.storage.queue.AzureQueueClient

-azurequeue.async=org.jclouds.azure.storage.queue.AzureQueueAsyncClient

-azurequeue.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder

-azurequeue.endpoint=https://{identity}.queue.core.windows.net

-

-azureblob.contextbuilder=org.jclouds.azure.storage.blob.AzureBlobContextBuilder

-azureblob.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder

-azureblob.endpoint=https://{identity}.blob.core.windows.net

-

-pcs.contextbuilder=org.jclouds.mezeo.pcs2.PCSContextBuilder

-pcs.apiVersion=unknown

-

-sdn.contextbuilder=org.jclouds.nirvanix.sdn.SDNContextBuilder

-sdn.propertiesbuilder=org.jclouds.nirvanix.sdn.SDNPropertiesBuilder

-

-sqs.contextbuilder=org.jclouds.aws.sqs.SQSContextBuilder

-sqs.propertiesbuilder=org.jclouds.aws.sqs.SQSPropertiesBuilder

-

-elb.contextbuilder=org.jclouds.aws.elb.ELBContextBuilder

-elb.propertiesbuilder=org.jclouds.aws.elb.ELBPropertiesBuilder

-

-cloudwatch.contextbuilder=org.jclouds.aws.cloudwatch.CloudWatchContextBuilder

-cloudwatch.propertiesbuilder=org.jclouds.aws.cloudwatch.CloudWatchPropertiesBuilder

-

-s3.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder

-s3.propertiesbuilder=org.jclouds.aws.s3.S3PropertiesBuilder

-

-ec2.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder

-ec2.propertiesbuilder=org.jclouds.aws.ec2.EC2PropertiesBuilder

-

-rimuhosting.contextbuilder=org.jclouds.rimuhosting.miro.RimuHostingContextBuilder

-rimuhosting.propertiesbuilder=org.jclouds.rimuhosting.miro.RimuHostingPropertiesBuilder

-

-slicehost.contextbuilder=org.jclouds.slicehost.SlicehostContextBuilder

-slicehost.propertiesbuilder=org.jclouds.slicehost.SlicehostPropertiesBuilder

-

-trmk-vcloudexpress.contextbuilder=org.jclouds.vcloud.terremark.TerremarkVCloudExpressContextBuilder

-trmk-vcloudexpress.propertiesbuilder=org.jclouds.vcloud.terremark.TerremarkVCloudExpressPropertiesBuilder

-

-trmk-ecloud.contextbuilder=org.jclouds.vcloud.terremark.TerremarkECloudContextBuilder

-trmk-ecloud.propertiesbuilder=org.jclouds.vcloud.terremark.TerremarkECloudPropertiesBuilder

-

-chef.contextbuilder=org.jclouds.chef.ChefContextBuilder

-chef.propertiesbuilder=org.jclouds.chef.ChefPropertiesBuilder

-

-transientchef.contextbuilder=org.jclouds.chef.test.TransientChefContextBuilder

-transientchef.propertiesbuilder=org.jclouds.chef.ChefPropertiesBuilder

-

-opscodeplatform.contextbuilder=org.jclouds.opscodeplatform.OpscodePlatformContextBuilder

-opscodeplatform.propertiesbuilder=org.jclouds.opscodeplatform.OpscodePlatformPropertiesBuilder

-

-vcloud.contextbuilder=org.jclouds.vcloud.VCloudContextBuilder

-vcloud.propertiesbuilder=org.jclouds.vcloud.VCloudPropertiesBuilder

-

-vcloudexpress.contextbuilder=org.jclouds.vcloud.VCloudExpressContextBuilder

-vcloudexpress.propertiesbuilder=org.jclouds.vcloud.VCloudExpressPropertiesBuilder

-

-eucalyptus.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder

-eucalyptus.propertiesbuilder=org.jclouds.aws.ec2.EucalyptusPropertiesBuilder

-

-nova.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder

-nova.propertiesbuilder=org.jclouds.aws.ec2.NovaPropertiesBuilder

-

-cloudservers.contextbuilder=org.jclouds.rackspace.cloudservers.CloudServersContextBuilder

-cloudservers.propertiesbuilder=org.jclouds.rackspace.RackspacePropertiesBuilder

-

-bluelock-vcdirector.contextbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorContextBuilder

-bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorPropertiesBuilder

-

-gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder

-gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder

-

-ibmdev.propertiesbuilder=org.jclouds.ibmdev.IBMDeveloperCloudPropertiesBuilder

-ibmdev.contextbuilder=org.jclouds.ibmdev.IBMDeveloperCloudContextBuilder

-

-stub.contextbuilder=org.jclouds.compute.stub.StubComputeServiceContextBuilder

-# example of where to change your endpoint

-# bluelock.endpoint=https://express3.bluelock.com/api

-

-atmosonline.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder

-atmosonline.endpoint=https://accesspoint.atmosonline.com

-atmosonline.apiversion=1.3.0

-

-synaptic.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder

-synaptic.endpoint=https://storage.synaptic.att.com

-synaptic.apiversion=1.3.0

-

-peer1-storage.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder

-peer1-storage.endpoint=https://storage.synaptic.att.com

-peer1-storage.apiversion=1.3.0

-

-# TODO hostedsolutions use atmos

-

-cloudfiles.contextbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesContextBuilder

-cloudfiles.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesPropertiesBuilder

-

-walrus.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder

-walrus.propertiesbuilder=org.jclouds.aws.s3.WalrusPropertiesBuilder

-

-googlestorage.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder

-googlestorage.propertiesbuilder=org.jclouds.aws.s3.GoogleStoragePropertiesBuilder

-

-transient.contextbuilder=org.jclouds.blobstore.TransientBlobStoreContextBuilder

-transient.propertiesbuilder=org.jclouds.blobstore.TransientBlobStorePropertiesBuilder

-

-filesystem.contextbuilder=org.jclouds.filesystem.FilesystemBlobStoreContextBuilder

-filesystem.propertiesbuilder=org.jclouds.filesystem.FilesystemBlobStorePropertiesBuilder

-

+#
+#
+# Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
+#
+# ====================================================================
+# 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.
+# ====================================================================
+#
+azurequeue.contextbuilder=org.jclouds.azure.storage.AzureStorageContextBuilder
+azurequeue.sync=org.jclouds.azure.storage.queue.AzureQueueClient
+azurequeue.async=org.jclouds.azure.storage.queue.AzureQueueAsyncClient
+azurequeue.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder
+azurequeue.endpoint=https://{identity}.queue.core.windows.net
+
+azureblob.contextbuilder=org.jclouds.azure.storage.blob.AzureBlobContextBuilder
+azureblob.propertiesbuilder=org.jclouds.azure.storage.AzureStoragePropertiesBuilder
+azureblob.endpoint=https://{identity}.blob.core.windows.net
+
+pcs.contextbuilder=org.jclouds.mezeo.pcs2.PCSContextBuilder
+pcs.apiVersion=unknown
+
+sdn.contextbuilder=org.jclouds.nirvanix.sdn.SDNContextBuilder
+sdn.propertiesbuilder=org.jclouds.nirvanix.sdn.SDNPropertiesBuilder
+
+sqs.contextbuilder=org.jclouds.aws.sqs.SQSContextBuilder
+sqs.propertiesbuilder=org.jclouds.aws.sqs.SQSPropertiesBuilder
+
+elb.contextbuilder=org.jclouds.aws.elb.ELBContextBuilder
+elb.propertiesbuilder=org.jclouds.aws.elb.ELBPropertiesBuilder
+
+cloudwatch.contextbuilder=org.jclouds.aws.cloudwatch.CloudWatchContextBuilder
+cloudwatch.propertiesbuilder=org.jclouds.aws.cloudwatch.CloudWatchPropertiesBuilder
+
+s3.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder
+s3.propertiesbuilder=org.jclouds.aws.s3.S3PropertiesBuilder
+
+ec2.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder
+ec2.propertiesbuilder=org.jclouds.aws.ec2.EC2PropertiesBuilder
+
+rimuhosting.contextbuilder=org.jclouds.rimuhosting.miro.RimuHostingContextBuilder
+rimuhosting.propertiesbuilder=org.jclouds.rimuhosting.miro.RimuHostingPropertiesBuilder
+
+slicehost.contextbuilder=org.jclouds.slicehost.SlicehostContextBuilder
+slicehost.propertiesbuilder=org.jclouds.slicehost.SlicehostPropertiesBuilder
+
+trmk-vcloudexpress.contextbuilder=org.jclouds.vcloud.terremark.TerremarkVCloudExpressContextBuilder
+trmk-vcloudexpress.propertiesbuilder=org.jclouds.vcloud.terremark.TerremarkVCloudExpressPropertiesBuilder
+
+trmk-ecloud.contextbuilder=org.jclouds.vcloud.terremark.TerremarkECloudContextBuilder
+trmk-ecloud.propertiesbuilder=org.jclouds.vcloud.terremark.TerremarkECloudPropertiesBuilder
+
+chef.contextbuilder=org.jclouds.chef.ChefContextBuilder
+chef.propertiesbuilder=org.jclouds.chef.ChefPropertiesBuilder
+
+transientchef.contextbuilder=org.jclouds.chef.test.TransientChefContextBuilder
+transientchef.propertiesbuilder=org.jclouds.chef.ChefPropertiesBuilder
+
+opscodeplatform.contextbuilder=org.jclouds.opscodeplatform.OpscodePlatformContextBuilder
+opscodeplatform.propertiesbuilder=org.jclouds.opscodeplatform.OpscodePlatformPropertiesBuilder
+
+vcloud.contextbuilder=org.jclouds.vcloud.VCloudContextBuilder
+vcloud.propertiesbuilder=org.jclouds.vcloud.VCloudPropertiesBuilder
+
+vcloudexpress.contextbuilder=org.jclouds.vcloud.VCloudExpressContextBuilder
+vcloudexpress.propertiesbuilder=org.jclouds.vcloud.VCloudExpressPropertiesBuilder
+
+eucalyptus.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder
+eucalyptus.propertiesbuilder=org.jclouds.aws.ec2.EucalyptusPropertiesBuilder
+
+nova.contextbuilder=org.jclouds.aws.ec2.EC2ContextBuilder
+nova.propertiesbuilder=org.jclouds.aws.ec2.NovaPropertiesBuilder
+
+cloudservers.contextbuilder=org.jclouds.rackspace.cloudservers.CloudServersContextBuilder
+cloudservers.propertiesbuilder=org.jclouds.rackspace.RackspacePropertiesBuilder
+
+bluelock-vcdirector.contextbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorContextBuilder
+bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloudDirectorPropertiesBuilder
+
+gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder
+gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder
+
+ibmdev.propertiesbuilder=org.jclouds.ibmdev.IBMDeveloperCloudPropertiesBuilder
+ibmdev.contextbuilder=org.jclouds.ibmdev.IBMDeveloperCloudContextBuilder
+
+stub.contextbuilder=org.jclouds.compute.stub.StubComputeServiceContextBuilder
+# example of where to change your endpoint
+# bluelock.endpoint=https://express3.bluelock.com/api
+
+atmosonline.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder
+atmosonline.endpoint=https://accesspoint.atmosonline.com
+atmosonline.apiversion=1.3.0
+
+synaptic.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder
+synaptic.endpoint=https://storage.synaptic.att.com
+synaptic.apiversion=1.3.0
+
+peer1-storage.contextbuilder=org.jclouds.atmosonline.saas.AtmosStorageContextBuilder
+peer1-storage.endpoint=https://storage.synaptic.att.com
+peer1-storage.apiversion=1.3.0
+
+# TODO hostedsolutions use atmos
+
+cloudfiles.contextbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesContextBuilder
+cloudfiles.propertiesbuilder=org.jclouds.rackspace.cloudfiles.CloudFilesPropertiesBuilder
+
+walrus.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder
+walrus.propertiesbuilder=org.jclouds.aws.s3.WalrusPropertiesBuilder
+
+googlestorage.contextbuilder=org.jclouds.aws.s3.S3ContextBuilder
+googlestorage.propertiesbuilder=org.jclouds.aws.s3.GoogleStoragePropertiesBuilder
+
+transient.contextbuilder=org.jclouds.blobstore.TransientBlobStoreContextBuilder
+transient.propertiesbuilder=org.jclouds.blobstore.TransientBlobStorePropertiesBuilder
+
+filesystem.contextbuilder=org.jclouds.filesystem.FilesystemBlobStoreContextBuilder
+filesystem.propertiesbuilder=org.jclouds.filesystem.FilesystemBlobStorePropertiesBuilder
\ No newline at end of file
diff --git a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java b/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java
index fb11dcc..b764f03 100644
--- a/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java
+++ b/demos/gae-tweetstore-spring/src/main/java/org/jclouds/demo/tweetstore/config/SpringServletConfig.java
@@ -1,202 +1,202 @@
-/**

- *

- * Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>

- *

- * ====================================================================

- * 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 org.jclouds.demo.tweetstore.config;

-

-import static com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.url;

-import static com.google.common.base.Preconditions.checkNotNull;

-import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER;

-

-import java.io.IOException;

-import java.io.InputStream;

-import java.util.Map;

-import java.util.Properties;

-import java.util.Set;

-

-import javax.annotation.PostConstruct;

-import javax.annotation.PreDestroy;

-import javax.servlet.Servlet;

-import javax.servlet.ServletConfig;

-import javax.servlet.ServletException;

-

-import org.jclouds.blobstore.BlobStoreContext;

-import org.jclouds.blobstore.BlobStoreContextFactory;

-import org.jclouds.demo.tweetstore.controller.AddTweetsController;

-import org.jclouds.demo.tweetstore.controller.StoreTweetsController;

-import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses;

-import org.jclouds.gae.config.GoogleAppEngineConfigurationModule;

-import org.springframework.beans.factory.BeanCreationException;

-import org.springframework.context.annotation.Bean;

-import org.springframework.context.annotation.Configuration;

-import org.springframework.web.context.ServletConfigAware;

-import org.springframework.web.servlet.HandlerAdapter;

-import org.springframework.web.servlet.HandlerMapping;

-import org.springframework.web.servlet.handler.SimpleServletHandlerAdapter;

-import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;

-

-import twitter4j.Twitter;

-import twitter4j.TwitterFactory;

-

-import com.google.appengine.api.labs.taskqueue.Queue;

-import com.google.appengine.api.labs.taskqueue.QueueFactory;

-import com.google.appengine.api.labs.taskqueue.TaskOptions.Method;

-import com.google.appengine.repackaged.com.google.common.base.Splitter;

-import com.google.common.collect.ImmutableSet;

-import com.google.common.collect.Maps;

-import com.google.common.io.Closeables;

-import com.google.inject.Module;

-

-/**

- * Creates servlets (using resources from the {@link SpringAppConfig}) and mappings.

- * 

- * @author Andrew Phillips

- * @see SpringAppConfig

- */

-@Configuration

-public class SpringServletConfig extends LoggingConfig implements ServletConfigAware {

-   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";

-

-   private ServletConfig servletConfig;

-

-   private Map<String, BlobStoreContext> providerTypeToBlobStoreMap;

-   private Twitter twitterClient;

-   private String container;

-

-   @PostConstruct

-   public void initialize() throws IOException {

-      BlobStoreContextFactory blobStoreContextFactory = new BlobStoreContextFactory();

-

-      Properties props = loadJCloudsProperties();

-      logger.trace("About to initialize members.");

-

-      Module googleModule = new GoogleAppEngineConfigurationModule();

-      Set<Module> modules = ImmutableSet.<Module> of(googleModule);

-      // shared across all blobstores and used to retrieve tweets

-      try {

-         twitterClient = new TwitterFactory().getInstance(props.getProperty("twitter.identity"),

-               props.getProperty("twitter.credential"));

-      } catch (IllegalArgumentException e) {

-         throw new IllegalArgumentException("properties for twitter not configured properly in " + props.toString(), e);

-      }

-      // common namespace for storing tweets

-      container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER);

-

-      // instantiate and store references to all blobstores by provider name

-      providerTypeToBlobStoreMap = Maps.newHashMap();

-      for (String hint : Splitter.on(',').split(

-            checkNotNull(props.getProperty(PROPERTY_BLOBSTORE_CONTEXTS), PROPERTY_BLOBSTORE_CONTEXTS))) {

-         providerTypeToBlobStoreMap.put(hint, blobStoreContextFactory.createContext(hint, modules, props));

-      }

-

-      // get a queue for submitting store tweet requests

-      Queue queue = QueueFactory.getQueue("twitter");

-      // submit a job to store tweets for each configured blobstore

-      for (String name : providerTypeToBlobStoreMap.keySet()) {

-         queue.add(url("/store/do").header("context", name).method(Method.GET));

-      }

-      logger.trace("Members initialized. Twitter: '%s', container: '%s', provider types: '%s'", twitterClient,

-            container, providerTypeToBlobStoreMap.keySet());

-   }

-

-   private Properties loadJCloudsProperties() {

-      logger.trace("About to read properties from '%s'", "/WEB-INF/jclouds.properties");

-      Properties props = new Properties();

-      InputStream input = servletConfig.getServletContext().getResourceAsStream("/WEB-INF/jclouds.properties");

-      try {

-         props.load(input);

-      } catch (IOException e) {

-         throw new RuntimeException(e);

-      } finally {

-         Closeables.closeQuietly(input);

-      }

-      logger.trace("Properties successfully read.");

-      return props;

-   }

-

-   @Bean

-   public StoreTweetsController storeTweetsController() {

-      StoreTweetsController controller = new StoreTweetsController(providerTypeToBlobStoreMap, container, twitterClient);

-      injectServletConfig(controller);

-      return controller;

-   }

-

-   @Bean

-   public AddTweetsController addTweetsController() {

-      AddTweetsController controller = new AddTweetsController(providerTypeToBlobStoreMap,

-            serviceToStoredTweetStatuses());

-      injectServletConfig(controller);

-      return controller;

-   }

-

-   private void injectServletConfig(Servlet servlet) {

-      logger.trace("About to inject servlet config '%s'", servletConfig);

-      try {

-         servlet.init(checkNotNull(servletConfig));

-      } catch (ServletException exception) {

-         throw new BeanCreationException("Unable to instantiate " + servlet, exception);

-      }

-      logger.trace("Successfully injected servlet config.");

-   }

-

-   @Bean

-   ServiceToStoredTweetStatuses serviceToStoredTweetStatuses() {

-      return new ServiceToStoredTweetStatuses(providerTypeToBlobStoreMap, container);

-   }

-

-   @Bean

-   public HandlerMapping handlerMapping() {

-      SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();

-      Map<String, Object> urlMap = Maps.newHashMapWithExpectedSize(2);

-      urlMap.put("/store/*", storeTweetsController());

-      urlMap.put("/tweets/*", addTweetsController());

-      mapping.setUrlMap(urlMap);

-      /*

-       * "/store" and "/tweets" are part of the servlet mapping and thus stripped by the mapping if

-       * using default settings.

-       */

-      mapping.setAlwaysUseFullPath(true);

-      return mapping;

-   }

-

-   @Bean

-   public HandlerAdapter servletHandlerAdapter() {

-      return new SimpleServletHandlerAdapter();

-   }

-

-   @PreDestroy

-   public void destroy() throws Exception {

-      logger.trace("About to close contexts.");

-      for (BlobStoreContext context : providerTypeToBlobStoreMap.values()) {

-         context.close();

-      }

-      logger.trace("Contexts closed.");

-   }

-

-   /*

-    * (non-Javadoc)

-    * 

-    * @see

-    * org.springframework.web.context.ServletConfigAware#setServletConfig(javax.servlet.ServletConfig

-    * )

-    */

-   @Override

-   public void setServletConfig(ServletConfig servletConfig) {

-      this.servletConfig = servletConfig;

-   }

-}

+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
+ *
+ * ====================================================================
+ * 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 org.jclouds.demo.tweetstore.config;
+
+import static com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.url;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.demo.tweetstore.reference.TweetStoreConstants.PROPERTY_TWEETSTORE_CONTAINER;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.jclouds.blobstore.BlobStoreContext;
+import org.jclouds.blobstore.BlobStoreContextFactory;
+import org.jclouds.demo.tweetstore.controller.AddTweetsController;
+import org.jclouds.demo.tweetstore.controller.StoreTweetsController;
+import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses;
+import org.jclouds.gae.config.GoogleAppEngineConfigurationModule;
+import org.springframework.beans.factory.BeanCreationException;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.context.ServletConfigAware;
+import org.springframework.web.servlet.HandlerAdapter;
+import org.springframework.web.servlet.HandlerMapping;
+import org.springframework.web.servlet.handler.SimpleServletHandlerAdapter;
+import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
+
+import twitter4j.Twitter;
+import twitter4j.TwitterFactory;
+
+import com.google.appengine.api.labs.taskqueue.Queue;
+import com.google.appengine.api.labs.taskqueue.QueueFactory;
+import com.google.appengine.api.labs.taskqueue.TaskOptions.Method;
+import com.google.appengine.repackaged.com.google.common.base.Splitter;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.google.common.io.Closeables;
+import com.google.inject.Module;
+
+/**
+ * Creates servlets (using resources from the {@link SpringAppConfig}) and mappings.
+ * 
+ * @author Andrew Phillips
+ * @see SpringAppConfig
+ */
+@Configuration
+public class SpringServletConfig extends LoggingConfig implements ServletConfigAware {
+   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
+
+   private ServletConfig servletConfig;
+
+   private Map<String, BlobStoreContext> providerTypeToBlobStoreMap;
+   private Twitter twitterClient;
+   private String container;
+
+   @PostConstruct
+   public void initialize() throws IOException {
+      BlobStoreContextFactory blobStoreContextFactory = new BlobStoreContextFactory();
+
+      Properties props = loadJCloudsProperties();
+      logger.trace("About to initialize members.");
+
+      Module googleModule = new GoogleAppEngineConfigurationModule();
+      Set<Module> modules = ImmutableSet.<Module> of(googleModule);
+      // shared across all blobstores and used to retrieve tweets
+      try {
+         twitterClient = new TwitterFactory().getInstance(props.getProperty("twitter.identity"),
+               props.getProperty("twitter.credential"));
+      } catch (IllegalArgumentException e) {
+         throw new IllegalArgumentException("properties for twitter not configured properly in " + props.toString(), e);
+      }
+      // common namespace for storing tweets
+      container = checkNotNull(props.getProperty(PROPERTY_TWEETSTORE_CONTAINER), PROPERTY_TWEETSTORE_CONTAINER);
+
+      // instantiate and store references to all blobstores by provider name
+      providerTypeToBlobStoreMap = Maps.newHashMap();
+      for (String hint : Splitter.on(',').split(
+            checkNotNull(props.getProperty(PROPERTY_BLOBSTORE_CONTEXTS), PROPERTY_BLOBSTORE_CONTEXTS))) {
+         providerTypeToBlobStoreMap.put(hint, blobStoreContextFactory.createContext(hint, modules, props));
+      }
+
+      // get a queue for submitting store tweet requests
+      Queue queue = QueueFactory.getQueue("twitter");
+      // submit a job to store tweets for each configured blobstore
+      for (String name : providerTypeToBlobStoreMap.keySet()) {
+         queue.add(url("/store/do").header("context", name).method(Method.GET));
+      }
+      logger.trace("Members initialized. Twitter: '%s', container: '%s', provider types: '%s'", twitterClient,
+            container, providerTypeToBlobStoreMap.keySet());
+   }
+
+   private Properties loadJCloudsProperties() {
+      logger.trace("About to read properties from '%s'", "/WEB-INF/jclouds.properties");
+      Properties props = new Properties();
+      InputStream input = servletConfig.getServletContext().getResourceAsStream("/WEB-INF/jclouds.properties");
+      try {
+         props.load(input);
+      } catch (IOException e) {
+         throw new RuntimeException(e);
+      } finally {
+         Closeables.closeQuietly(input);
+      }
+      logger.trace("Properties successfully read.");
+      return props;
+   }
+
+   @Bean
+   public StoreTweetsController storeTweetsController() {
+      StoreTweetsController controller = new StoreTweetsController(providerTypeToBlobStoreMap, container, twitterClient);
+      injectServletConfig(controller);
+      return controller;
+   }
+
+   @Bean
+   public AddTweetsController addTweetsController() {
+      AddTweetsController controller = new AddTweetsController(providerTypeToBlobStoreMap,
+            serviceToStoredTweetStatuses());
+      injectServletConfig(controller);
+      return controller;
+   }
+
+   private void injectServletConfig(Servlet servlet) {
+      logger.trace("About to inject servlet config '%s'", servletConfig);
+      try {
+         servlet.init(checkNotNull(servletConfig));
+      } catch (ServletException exception) {
+         throw new BeanCreationException("Unable to instantiate " + servlet, exception);
+      }
+      logger.trace("Successfully injected servlet config.");
+   }
+
+   @Bean
+   ServiceToStoredTweetStatuses serviceToStoredTweetStatuses() {
+      return new ServiceToStoredTweetStatuses(providerTypeToBlobStoreMap, container);
+   }
+
+   @Bean
+   public HandlerMapping handlerMapping() {
+      SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
+      Map<String, Object> urlMap = Maps.newHashMapWithExpectedSize(2);
+      urlMap.put("/store/*", storeTweetsController());
+      urlMap.put("/tweets/*", addTweetsController());
+      mapping.setUrlMap(urlMap);
+      /*
+       * "/store" and "/tweets" are part of the servlet mapping and thus stripped by the mapping if
+       * using default settings.
+       */
+      mapping.setAlwaysUseFullPath(true);
+      return mapping;
+   }
+
+   @Bean
+   public HandlerAdapter servletHandlerAdapter() {
+      return new SimpleServletHandlerAdapter();
+   }
+
+   @PreDestroy
+   public void destroy() throws Exception {
+      logger.trace("About to close contexts.");
+      for (BlobStoreContext context : providerTypeToBlobStoreMap.values()) {
+         context.close();
+      }
+      logger.trace("Contexts closed.");
+   }
+
+   /*
+    * (non-Javadoc)
+    * 
+    * @see
+    * org.springframework.web.context.ServletConfigAware#setServletConfig(javax.servlet.ServletConfig
+    * )
+    */
+   @Override
+   public void setServletConfig(ServletConfig servletConfig) {
+      this.servletConfig = servletConfig;
+   }
+}
\ No newline at end of file
diff --git a/rimuhosting/pom.xml b/rimuhosting/pom.xml
index 8915c0e..6ea3e1e 100644
--- a/rimuhosting/pom.xml
+++ b/rimuhosting/pom.xml
@@ -1,129 +1,129 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-

-

-    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>

-

-    ====================================================================

-    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.

-    ====================================================================

-

--->

-

-<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>

-    <parent>

-        <groupId>org.jclouds</groupId>

-        <artifactId>jclouds-project</artifactId>

-        <version>1.0-SNAPSHOT</version>

-        <relativePath>../project/pom.xml</relativePath>

-    </parent>

-    <artifactId>jclouds-rimuhosting</artifactId>

-    <name>jclouds RimuHosting core</name>

-    <description>jclouds components to access RimuHosting</description>

-

-    <scm>

-        <connection>scm:svn:http://jclouds.googlecode.com/svn/trunk/rimuhosting</connection>

-        <developerConnection>scm:svn:https://jclouds.googlecode.com/svn/trunk/rimuhosting</developerConnection>

-        <url>http://jclouds.googlecode.com/svn/trunk/rimuhosting</url>

-    </scm>

-    <properties>

-        <!-- when instances are hung, open a ticket and add here -->

-        <jclouds.compute.blacklist-nodes>trmkrun-ccc,test.trmk-924</jclouds.compute.blacklist-nodes>

-        <test.rimuhosting.endpoint>https://api.rimuhosting.com/r</test.rimuhosting.endpoint>

-        <test.rimuhosting.apiversion>1.0</test.rimuhosting.apiversion>

-        <test.rimuhosting.identity>FIXME</test.rimuhosting.identity>

-    </properties>

-    <dependencies>

-        <dependency>

-            <groupId>${project.groupId}</groupId>

-            <artifactId>jclouds-jsch</artifactId>

-            <version>${project.version}</version>

-            <scope>test</scope>

-        </dependency>

-        <dependency>

-            <groupId>${project.groupId}</groupId>

-            <artifactId>jclouds-core</artifactId>

-            <version>${project.version}</version>

-            <type>test-jar</type> 

-            <scope>test</scope>

-        </dependency>

-        <dependency>

-            <groupId>${project.groupId}</groupId>

-            <artifactId>jclouds-compute</artifactId>

-            <version>${project.version}</version>

-        </dependency>

-        <dependency>

-            <groupId>${project.groupId}</groupId>

-            <artifactId>jclouds-compute</artifactId>

-            <version>${project.version}</version>

-            <type>test-jar</type>

-            <scope>test</scope>

-        </dependency>

-        <dependency>

-            <groupId>log4j</groupId>

-            <artifactId>log4j</artifactId>

-            <version>1.2.14</version>

-            <scope>test</scope>

-        </dependency>

-        <dependency>

-            <groupId>${project.groupId}</groupId>

-            <artifactId>jclouds-log4j</artifactId>

-            <version>${project.version}</version>

-            <scope>test</scope>

-        </dependency>

-    </dependencies>

-    <profiles>

-        <profile>

-            <id>live</id>

-            <build>

-                <plugins>

-                    <plugin>

-                        <groupId>org.apache.maven.plugins</groupId>

-                        <artifactId>maven-surefire-plugin</artifactId>

-                        <executions>

-                            <execution>

-                                <id>integration</id>

-                                <phase>integration-test</phase>

-                                <goals>

-                                    <goal>test</goal>

-                                </goals>

-                                <configuration>

-                                    <systemProperties>

-                                        <property>

-                                            <name>test.rimuhosting.endpoint</name>

-                                            <value>${test.rimuhosting.endpoint}</value>

-                                        </property>

-                                        <property>

-                                            <name>test.rimuhosting.apiversion</name>

-                                            <value>${test.rimuhosting.apiversion}</value>

-                                        </property>

-                                        <property>

-                                            <name>test.rimuhosting.identity</name>

-                                            <value>${test.rimuhosting.identity}</value>

-                                        </property>

-                                        <property>

-                                            <name>jclouds.compute.blacklist-nodes</name>

-                                            <value>${jclouds.compute.blacklist-nodes}</value>

-                                        </property>

-                                    </systemProperties>

-                                </configuration>

-                            </execution>

-                        </executions>

-                    </plugin>

-                </plugins>

-            </build>

-        </profile>

-    </profiles>

-</project>

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
+
+    ====================================================================
+    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.
+    ====================================================================
+
+-->
+
+<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>
+    <parent>
+        <groupId>org.jclouds</groupId>
+        <artifactId>jclouds-project</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../project/pom.xml</relativePath>
+    </parent>
+    <artifactId>jclouds-rimuhosting</artifactId>
+    <name>jclouds RimuHosting core</name>
+    <description>jclouds components to access RimuHosting</description>
+
+    <scm>
+        <connection>scm:svn:http://jclouds.googlecode.com/svn/trunk/rimuhosting</connection>
+        <developerConnection>scm:svn:https://jclouds.googlecode.com/svn/trunk/rimuhosting</developerConnection>
+        <url>http://jclouds.googlecode.com/svn/trunk/rimuhosting</url>
+    </scm>
+    <properties>
+        <!-- when instances are hung, open a ticket and add here -->
+        <jclouds.compute.blacklist-nodes>trmkrun-ccc,test.trmk-924</jclouds.compute.blacklist-nodes>
+        <test.rimuhosting.endpoint>https://api.rimuhosting.com/r</test.rimuhosting.endpoint>
+        <test.rimuhosting.apiversion>1.0</test.rimuhosting.apiversion>
+        <test.rimuhosting.identity>FIXME</test.rimuhosting.identity>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jclouds-jsch</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jclouds-core</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type> 
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jclouds-compute</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jclouds-compute</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>jclouds-log4j</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <profiles>
+        <profile>
+            <id>live</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>integration</id>
+                                <phase>integration-test</phase>
+                                <goals>
+                                    <goal>test</goal>
+                                </goals>
+                                <configuration>
+                                    <systemProperties>
+                                        <property>
+                                            <name>test.rimuhosting.endpoint</name>
+                                            <value>${test.rimuhosting.endpoint}</value>
+                                        </property>
+                                        <property>
+                                            <name>test.rimuhosting.apiversion</name>
+                                            <value>${test.rimuhosting.apiversion}</value>
+                                        </property>
+                                        <property>
+                                            <name>test.rimuhosting.identity</name>
+                                            <value>${test.rimuhosting.identity}</value>
+                                        </property>
+                                        <property>
+                                            <name>jclouds.compute.blacklist-nodes</name>
+                                            <value>${jclouds.compute.blacklist-nodes}</value>
+                                        </property>
+                                    </systemProperties>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file
diff --git a/sandbox/vfs/samples/vfs-ant/build.xml b/sandbox/vfs/samples/vfs-ant/build.xml
index 7bf3be0..904a506 100644
--- a/sandbox/vfs/samples/vfs-ant/build.xml
+++ b/sandbox/vfs/samples/vfs-ant/build.xml
@@ -1,39 +1,39 @@
-<!--

-

-

-    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>

-

-    ====================================================================

-    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.

-    ====================================================================

-

--->

-

-<project name="test-copy" default="copy" basedir=".">

-

-        <!-- Note you need to have a copy of jclouds-vfs-1.0-beta-3-jar-with-dependencies.jar in an ant lib directory

-             Due to weird classloading issues, vfs will not work dynamically loaded -->

-        <taskdef resource="org/apache/commons/vfs/tasks/tasks.properties" />

-

-	<property name="jclouds.blobstore.url" value="blobstore://${jclouds.blobstore.account}:${jclouds.blobstore.key}@${jclouds.blobstore.provider}" />

-        <property name="jclouds.blobstore.container" value="jclouds-demo" />

-

-	<target name="copy">

-          <v-copy

-            destdir="${jclouds.blobstore.url}/${jclouds.blobstore.container}"

-            src="http://mirror.cc.columbia.edu/pub/software/apache/maven/binaries/apache-maven-2.2.1-bin.zip"

-            overwrite="true"

-            preservelastmodified="false"/>

-        </target>

-

-</project>

+<!--
+
+
+    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
+
+    ====================================================================
+    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.
+    ====================================================================
+
+-->
+
+<project name="test-copy" default="copy" basedir=".">
+
+        <!-- Note you need to have a copy of jclouds-vfs-1.0-beta-3-jar-with-dependencies.jar in an ant lib directory
+             Due to weird classloading issues, vfs will not work dynamically loaded -->
+        <taskdef resource="org/apache/commons/vfs/tasks/tasks.properties" />
+
+	<property name="jclouds.blobstore.url" value="blobstore://${jclouds.blobstore.account}:${jclouds.blobstore.key}@${jclouds.blobstore.provider}" />
+        <property name="jclouds.blobstore.container" value="jclouds-demo" />
+
+	<target name="copy">
+          <v-copy
+            destdir="${jclouds.blobstore.url}/${jclouds.blobstore.container}"
+            src="http://mirror.cc.columbia.edu/pub/software/apache/maven/binaries/apache-maven-2.2.1-bin.zip"
+            overwrite="true"
+            preservelastmodified="false"/>
+        </target>
+
+</project>
diff --git a/scriptbuilder/src/test/resources/client_rb.cmd b/scriptbuilder/src/test/resources/client_rb.cmd
index d7bd4e6..4f74c24 100644
--- a/scriptbuilder/src/test/resources/client_rb.cmd
+++ b/scriptbuilder/src/test/resources/client_rb.cmd
@@ -1,3 +1,3 @@
-echo log_level :info>>c:\etc\chef\client.rb

-echo log_location STDOUT>>c:\etc\chef\client.rb

-echo chef_server_url "http://localhost:4000">>c:\etc\chef\client.rb

+echo log_level :info>>c:\etc\chef\client.rb
+echo log_location STDOUT>>c:\etc\chef\client.rb
+echo chef_server_url "http://localhost:4000">>c:\etc\chef\client.rb
diff --git a/scriptbuilder/src/test/resources/test_init.cmd b/scriptbuilder/src/test/resources/test_init.cmd
index f7cc270..283ea07 100644
--- a/scriptbuilder/src/test/resources/test_init.cmd
+++ b/scriptbuilder/src/test/resources/test_init.cmd
@@ -1,134 +1,134 @@
-@echo off

-set PATH=

-set JAVA_HOME=

-set PATH=

-GOTO FUNCTION_END

-:abort

-   echo aborting: %EXCEPTION%

-   exit /b 1

-:default

-   set INSTANCE_NAME=mkebsboot

-set INSTANCE_HOME=/mnt/tmp

-set LOG_DIR=/mnt/tmp

-   exit /b 0

-:mkebsboot

-   set TMP_DIR=/mnt/tmp

-   exit /b 0

-:findPid

-   set FOUND_PID=

-   set _expression=%1

-   shift

-   set FIND_PROCESS=TASKLIST /FI "WINDOWTITLE eq %_expression%" /NH

-   FOR /F "usebackq tokens=2 delims= " %%A IN (`cmd /c "%FIND_PROCESS% 2>NUL"`) DO (

-      SET FOUND_PID=%%A

-   )

-   if defined FOUND_PID (

-      exit /b 0

-   ) else (

-      set EXCEPTION=%_expression% not found

-      exit /b 1

-   )

-:forget

-   SETLOCAL

-   set FOUND_PID=

-   set NEXT_MINUTE=

-   set INSTANCE_NAME=%1

-   shift

-   set SCRIPT=%1

-   shift

-   set LOG_DIR=%1

-   shift

-   CALL :findProcess %INSTANCE_NAME%

-   if defined FOUND_PID (

-      echo %INSTANCE_NAME% already running pid [%FOUND_PID%]

-   ) else (

-      CALL :nextMinute

-      set _DATE=%DATE:~4%

-      set CMD=schtasks /create /sd %_DATE% /tn %INSTANCE_NAME% /ru System /tr "cmd /c title %INSTANCE_NAME%&%SCRIPT% >%LOG_DIR%\stdout.log 2>%LOG_DIR%\stderr.log" /sc:once /st %NEXT_MINUTE%

-      echo %INSTANCE_NAME% will start at %NEXT_MINUTE%

-      set SECONDS=%TIME:~6,2%

-      set /a SECOND=60-SECONDS

-      %CMD% >NUL

-      ping -n %SECONDS% 127.0.0.1 > NUL 2>&1

-      CALL :findProcess %INSTANCE_NAME%

-      if not defined FOUND_PID (

-         set EXCEPTION=%INSTANCE_NAME% did not start

-         abort

-      )

-   ) 

-   exit /b 0

-:FUNCTION_END

-set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem

-if not "%1" == "init" if not "%1" == "status" if not "%1" == "stop" if not "%1" == "start" if not "%1" == "tail" if not "%1" == "tailerr" if not "%1" == "run" (

-   set EXCEPTION=bad argument: %1 not in init status stop start tail tailerr run

-   goto abort

-)

-goto CASE_%1

-:CASE_init

-   call :default

-   if errorlevel 1 goto abort

-   call :mkebsboot

-   if errorlevel 1 goto abort

-   md %INSTANCE_HOME%

-   del %INSTANCE_HOME%\mkebsboot.cmd 2>NUL

-   echo @echo off>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo title mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_NAME=mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set TMP_DIR=%TMP_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_NAME=%INSTANCE_NAME%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_HOME=%INSTANCE_HOME%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set LOG_DIR=%LOG_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo cd /d %%INSTANCE_HOME%%>>%INSTANCE_HOME%\mkebsboot.cmd

-   md %INSTANCE_HOME%

-   del %INSTANCE_HOME%\mkebsboot.cmd 2>NUL

-   echo @echo off>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo title mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_NAME=mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set TMP_DIR=%TMP_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_NAME=%INSTANCE_NAME%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set INSTANCE_HOME=%INSTANCE_HOME%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo set LOG_DIR=%LOG_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo cd /d %%INSTANCE_HOME%%>>%INSTANCE_HOME%\mkebsboot.cmd

-   echo exit /b 0 >>%INSTANCE_HOME%\mkebsboot.cmd

-   GOTO END_SWITCH

-:CASE_status

-   call :default

-   if errorlevel 1 goto abort

-   call :findPid %INSTANCE_NAME%

-   if errorlevel 1 goto abort

-   echo [%FOUND_PID%]

-   GOTO END_SWITCH

-:CASE_stop

-   call :default

-   if errorlevel 1 goto abort

-   call :findPid %INSTANCE_NAME%

-   if errorlevel 1 goto abort

-   if defined FOUND_PID (

-      TASKKILL /F /T /PID %FOUND_PID% >NUL

-   )

-   GOTO END_SWITCH

-:CASE_start

-   call :default

-   if errorlevel 1 goto abort

-   call :forget %INSTANCE_NAME% %INSTANCE_HOME%\%INSTANCE_NAME%.cmd %LOG_DIR%

-   if errorlevel 1 goto abort

-   GOTO END_SWITCH

-:CASE_tail

-   call :default

-   if errorlevel 1 goto abort

-   tail %LOG_DIR%\stdout.log

-   GOTO END_SWITCH

-:CASE_tailerr

-   call :default

-   if errorlevel 1 goto abort

-   tail %LOG_DIR%\stderr.log

-   GOTO END_SWITCH

-:CASE_run

-   call :default

-   if errorlevel 1 goto abort

-   %INSTANCE_HOME%\%INSTANCE_NAME%.cmd

-   GOTO END_SWITCH

-:END_SWITCH

-exit /b 0

+@echo off
+set PATH=
+set JAVA_HOME=
+set PATH=
+GOTO FUNCTION_END
+:abort
+   echo aborting: %EXCEPTION%
+   exit /b 1
+:default
+   set INSTANCE_NAME=mkebsboot
+set INSTANCE_HOME=/mnt/tmp
+set LOG_DIR=/mnt/tmp
+   exit /b 0
+:mkebsboot
+   set TMP_DIR=/mnt/tmp
+   exit /b 0
+:findPid
+   set FOUND_PID=
+   set _expression=%1
+   shift
+   set FIND_PROCESS=TASKLIST /FI "WINDOWTITLE eq %_expression%" /NH
+   FOR /F "usebackq tokens=2 delims= " %%A IN (`cmd /c "%FIND_PROCESS% 2>NUL"`) DO (
+      SET FOUND_PID=%%A
+   )
+   if defined FOUND_PID (
+      exit /b 0
+   ) else (
+      set EXCEPTION=%_expression% not found
+      exit /b 1
+   )
+:forget
+   SETLOCAL
+   set FOUND_PID=
+   set NEXT_MINUTE=
+   set INSTANCE_NAME=%1
+   shift
+   set SCRIPT=%1
+   shift
+   set LOG_DIR=%1
+   shift
+   CALL :findProcess %INSTANCE_NAME%
+   if defined FOUND_PID (
+      echo %INSTANCE_NAME% already running pid [%FOUND_PID%]
+   ) else (
+      CALL :nextMinute
+      set _DATE=%DATE:~4%
+      set CMD=schtasks /create /sd %_DATE% /tn %INSTANCE_NAME% /ru System /tr "cmd /c title %INSTANCE_NAME%&%SCRIPT% >%LOG_DIR%\stdout.log 2>%LOG_DIR%\stderr.log" /sc:once /st %NEXT_MINUTE%
+      echo %INSTANCE_NAME% will start at %NEXT_MINUTE%
+      set SECONDS=%TIME:~6,2%
+      set /a SECOND=60-SECONDS
+      %CMD% >NUL
+      ping -n %SECONDS% 127.0.0.1 > NUL 2>&1
+      CALL :findProcess %INSTANCE_NAME%
+      if not defined FOUND_PID (
+         set EXCEPTION=%INSTANCE_NAME% did not start
+         abort
+      )
+   ) 
+   exit /b 0
+:FUNCTION_END
+set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem
+if not "%1" == "init" if not "%1" == "status" if not "%1" == "stop" if not "%1" == "start" if not "%1" == "tail" if not "%1" == "tailerr" if not "%1" == "run" (
+   set EXCEPTION=bad argument: %1 not in init status stop start tail tailerr run
+   goto abort
+)
+goto CASE_%1
+:CASE_init
+   call :default
+   if errorlevel 1 goto abort
+   call :mkebsboot
+   if errorlevel 1 goto abort
+   md %INSTANCE_HOME%
+   del %INSTANCE_HOME%\mkebsboot.cmd 2>NUL
+   echo @echo off>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo title mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_NAME=mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set TMP_DIR=%TMP_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_NAME=%INSTANCE_NAME%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_HOME=%INSTANCE_HOME%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set LOG_DIR=%LOG_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo cd /d %%INSTANCE_HOME%%>>%INSTANCE_HOME%\mkebsboot.cmd
+   md %INSTANCE_HOME%
+   del %INSTANCE_HOME%\mkebsboot.cmd 2>NUL
+   echo @echo off>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo title mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_NAME=mkebsboot>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set TMP_DIR=%TMP_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_NAME=%INSTANCE_NAME%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set INSTANCE_HOME=%INSTANCE_HOME%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo set LOG_DIR=%LOG_DIR%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo cd /d %%INSTANCE_HOME%%>>%INSTANCE_HOME%\mkebsboot.cmd
+   echo exit /b 0 >>%INSTANCE_HOME%\mkebsboot.cmd
+   GOTO END_SWITCH
+:CASE_status
+   call :default
+   if errorlevel 1 goto abort
+   call :findPid %INSTANCE_NAME%
+   if errorlevel 1 goto abort
+   echo [%FOUND_PID%]
+   GOTO END_SWITCH
+:CASE_stop
+   call :default
+   if errorlevel 1 goto abort
+   call :findPid %INSTANCE_NAME%
+   if errorlevel 1 goto abort
+   if defined FOUND_PID (
+      TASKKILL /F /T /PID %FOUND_PID% >NUL
+   )
+   GOTO END_SWITCH
+:CASE_start
+   call :default
+   if errorlevel 1 goto abort
+   call :forget %INSTANCE_NAME% %INSTANCE_HOME%\%INSTANCE_NAME%.cmd %LOG_DIR%
+   if errorlevel 1 goto abort
+   GOTO END_SWITCH
+:CASE_tail
+   call :default
+   if errorlevel 1 goto abort
+   tail %LOG_DIR%\stdout.log
+   GOTO END_SWITCH
+:CASE_tailerr
+   call :default
+   if errorlevel 1 goto abort
+   tail %LOG_DIR%\stderr.log
+   GOTO END_SWITCH
+:CASE_run
+   call :default
+   if errorlevel 1 goto abort
+   %INSTANCE_HOME%\%INSTANCE_NAME%.cmd
+   GOTO END_SWITCH
+:END_SWITCH
+exit /b 0
diff --git a/scriptbuilder/src/test/resources/test_runrun.cmd b/scriptbuilder/src/test/resources/test_runrun.cmd
index ab5cf7c..45fab93 100644
--- a/scriptbuilder/src/test/resources/test_runrun.cmd
+++ b/scriptbuilder/src/test/resources/test_runrun.cmd
@@ -1,17 +1,17 @@
-md %TEMP%\%USERNAME%\scripttest

-del %TEMP%\%USERNAME%\scripttest\yahooprod.cmd 2>NUL

-echo @echo off>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo title yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set INSTANCE_NAME=yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set JAVA_HOME=%JAVA_HOME%>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo cd /d %TEMP%\%USERNAME%\scripttest>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-md %TEMP%\%USERNAME%\scripttest

-del %TEMP%\%USERNAME%\scripttest\yahooprod.cmd 2>NUL

-echo @echo off>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo title yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set INSTANCE_NAME=yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo set JAVA_HOME=%JAVA_HOME%>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo cd /d %TEMP%\%USERNAME%\scripttest>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

-echo exit /b 0 >>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd

+md %TEMP%\%USERNAME%\scripttest
+del %TEMP%\%USERNAME%\scripttest\yahooprod.cmd 2>NUL
+echo @echo off>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo title yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set INSTANCE_NAME=yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set JAVA_HOME=%JAVA_HOME%>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo cd /d %TEMP%\%USERNAME%\scripttest>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+md %TEMP%\%USERNAME%\scripttest
+del %TEMP%\%USERNAME%\scripttest\yahooprod.cmd 2>NUL
+echo @echo off>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo title yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set INSTANCE_NAME=yahooprod>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo set JAVA_HOME=%JAVA_HOME%>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo cd /d %TEMP%\%USERNAME%\scripttest>>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
+echo exit /b 0 >>%TEMP%\%USERNAME%\scripttest\yahooprod.cmd
diff --git a/scriptbuilder/src/test/resources/test_script.cmd b/scriptbuilder/src/test/resources/test_script.cmd
index 0c20094..9f70acf 100644
--- a/scriptbuilder/src/test/resources/test_script.cmd
+++ b/scriptbuilder/src/test/resources/test_script.cmd
@@ -1,35 +1,35 @@
-@echo off

-set PATH=

-set JAVA_HOME=

-set PATH=

-set RUNTIME=

-GOTO FUNCTION_END

-:abort

-   echo aborting: %EXCEPTION%

-   exit /b 1

-:default

-   set RUNTIME=Moo

-   exit /b 0

-:FUNCTION_END

-set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem

-if not "%1" == "start" if not "%1" == "stop" if not "%1" == "status" (

-   set EXCEPTION=bad argument: %1 not in start stop status

-   goto abort

-)

-goto CASE_%1

-:CASE_start

-   call :default

-   if errorlevel 1 goto abort

-   echo start %RUNTIME%

-   GOTO END_SWITCH

-:CASE_stop

-   call :default

-   if errorlevel 1 goto abort

-   echo stop %RUNTIME%

-   GOTO END_SWITCH

-:CASE_status

-   echo hello world>>%TEMP%\%USERNAME%\scripttest\temp.txt

-   echo the following should be []: [%RUNTIME%]

-   GOTO END_SWITCH

-:END_SWITCH

-exit /b 0

+@echo off
+set PATH=
+set JAVA_HOME=
+set PATH=
+set RUNTIME=
+GOTO FUNCTION_END
+:abort
+   echo aborting: %EXCEPTION%
+   exit /b 1
+:default
+   set RUNTIME=Moo
+   exit /b 0
+:FUNCTION_END
+set PATH=c:\windows\;C:\windows\system32;c:\windows\system32\wbem
+if not "%1" == "start" if not "%1" == "stop" if not "%1" == "status" (
+   set EXCEPTION=bad argument: %1 not in start stop status
+   goto abort
+)
+goto CASE_%1
+:CASE_start
+   call :default
+   if errorlevel 1 goto abort
+   echo start %RUNTIME%
+   GOTO END_SWITCH
+:CASE_stop
+   call :default
+   if errorlevel 1 goto abort
+   echo stop %RUNTIME%
+   GOTO END_SWITCH
+:CASE_status
+   echo hello world>>%TEMP%\%USERNAME%\scripttest\temp.txt
+   echo the following should be []: [%RUNTIME%]
+   GOTO END_SWITCH
+:END_SWITCH
+exit /b 0
diff --git a/tools/antcontrib/samples/compute/build.xml b/tools/antcontrib/samples/compute/build.xml
index c64cf06..b4a1dab 100644
--- a/tools/antcontrib/samples/compute/build.xml
+++ b/tools/antcontrib/samples/compute/build.xml
@@ -1,192 +1,192 @@
-<!--

-

-

-    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>

-

-    ====================================================================

-    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.

-    ====================================================================

-

--->

-

-<project name="compute" default="dump" basedir="." xmlns:artifact="urn:maven-artifact-ant">

-  <property file="build.properties" />

-  <property name="jclouds.version" value="1.0-SNAPSHOT" />

-  <property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />

-  <property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />

-

-  <mkdir dir="build" />

-

-  <get src="http://opensource.become.com/apache//maven/binaries/maven-ant-tasks-2.1.1.jar" dest="build/maven-ant-tasks.jar"/>

-

-  <input

-    message="Which provider would you like to use (ec2, cloudservers, vcloud, terremark, rimuhosting)?"

-    validargs="ec2,cloudservers,vcloud,trmk-ecloud,trmk-vcloudexpress,eucalyptus,bluelock-vcdirector,gogrid,rimuhosting"

-    addproperty="provider"

-  />

-

-  <input

-    message="Which driver does ${provider} use?"

-    validargs="aws,rackspace,vcloud,bluelock,gogrid,terremark,ibmdev,rimuhosting"

-    addproperty="driver"

-  />

-

-  <path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks.jar" />

-  <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />

-

-  <artifact:localRepository id="local.repository" path="${user.home}/.m2/repository" />

-  <artifact:remoteRepository id="jclouds.repository" url="http://jclouds.googlecode.com/svn/repo" />

-  <artifact:remoteRepository id="jclouds-snapshot.repository" url="https://oss.sonatype.org/content/repositories/snapshots" />

-

-  <artifact:dependencies pathId="jclouds.classpath">

-    <dependency groupId="org.jclouds" artifactId="jclouds-antcontrib" version="${jclouds.version}" />

-    <dependency groupId="org.jclouds" artifactId="jclouds-${driver}" version="${jclouds.version}" />

-    <localRepository refid="local.repository" />

-    <remoteRepository refid="jclouds.repository" />

-    <remoteRepository refid="jclouds-snapshot.repository" />

-  </artifact:dependencies>

-

-  <typedef name="compute" classname="org.jclouds.tools.ant.taskdefs.compute.ComputeTask" classpathref="jclouds.classpath" />

-

-  <input

-    message="What is your identity on ${provider}?"

-    addproperty="identity"

-  />

-

-  <input

-    message="What is the credential for ${identity}?"

-    addproperty="credential"

-  />

-

-  <property name="jclouds.compute.url" value="compute://${identity}:${credential}@${provider}" />

-

-  <target name="list" description="list the identity of all nodes">

-    <compute actions="list" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="list-details" description="list the details of all nodes">

-    <compute actions="list-details" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="list-images" description="list the images supported">

-    <compute actions="list-images" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="list-hardwares" description="list the hardwares supported">

-    <compute actions="list-sizes" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="list-locations" description="list the locations supported">

-    <compute actions="list-locations" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="dump" description="list all information we can obtain about the cloud">

-    <compute actions="list-locations,list-sizes,list-images,list-details" provider="${jclouds.compute.url}" />

-  </target>

-

-  <target name="reboot" depends="reboot-id,reboot-tag" />

-

-  <target name="reboot-id" description="reboot the node ${id}" unless="tag">

-

-    <input

-      message="Which node do you wish to reboot"

-      addproperty="id"

-    />

-

-    <compute actions="reboot" provider="${jclouds.compute.url}">

-      <nodes id="${id}" />

-    </compute>

-  </target>

-

-  <target name="reboot-tag" description="reboot the nodes with tag ${tag}" unless="id" >

-

-    <input

-      message="Which tag do you wish to reboot"

-      addproperty="tag"

-    />

-

-    <compute actions="reboot" provider="${jclouds.compute.url}">

-      <nodes tag="${tag}" />

-    </compute>

-  </target>

-

-  <target name="destroy" depends="destroy-id,destroy-tag" />

-

-  <target name="destroy-id" description="destroy the node ${id}" unless="tag">

-

-    <input

-      message="Which node do you wish to destroy"

-      addproperty="id"

-    />

-

-    <compute actions="destroy" provider="${jclouds.compute.url}">

-      <nodes id="${id}" />

-    </compute>

-  </target>

-

-  <target name="destroy-tag" description="destroy the nodes with tag ${tag}" unless="id" >

-

-    <input

-      message="Which tag do you wish to destroy"

-      addproperty="tag"

-    />

-

-    <compute actions="destroy" provider="${jclouds.compute.url}">

-      <nodes tag="${tag}" />

-    </compute>

-  </target>

-

-  <target name="get" depends="get-tag,get-id" />

-

-  <target name="get-id" description="get the node ${id}" unless="tag">

-

-    <input

-      message="Which node do you wish to get"

-      addproperty="id"

-    />

-

-    <compute actions="get" provider="${jclouds.compute.url}">

-      <nodes id="${id}" />

-    </compute>

-  </target>

-

-  <target name="get-tag" description="get the nodes with tag ${tag}" unless="id" >

-

-    <input

-      message="Which tag do you wish to get"

-      addproperty="tag"

-    />

-

-    <compute actions="get" provider="${jclouds.compute.url}">

-      <nodes tag="${tag}" />

-    </compute>

-  </target>

-

-  <property name="location" value="" />

-  <target name="create" description="create the node ${tag}">

-    <property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />

-    <property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />

-    <property name="os" value="UBUNTU" />

-    <property name="count" value="1" />

-

-    <input

-      message="What do you want to tag your nodes with?"

-      addproperty="tag"

-    />

-

-    <compute actions="create" provider="${jclouds.compute.url}">

-      <nodes privatekeyfile="${privatekeyfile}" publickeyfile="${publickeyfile}" tag="${tag}" count="${count}" os="${os}" hardware="SMALLEST" hostproperty="host" usernameproperty="username" passwordproperty="password" />

-    </compute>

-  </target>

-

-</project>

+<!--
+
+
+    Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
+
+    ====================================================================
+    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.
+    ====================================================================
+
+-->
+
+<project name="compute" default="dump" basedir="." xmlns:artifact="urn:maven-artifact-ant">
+  <property file="build.properties" />
+  <property name="jclouds.version" value="1.0-SNAPSHOT" />
+  <property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />
+  <property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />
+
+  <mkdir dir="build" />
+
+  <get src="http://opensource.become.com/apache//maven/binaries/maven-ant-tasks-2.1.1.jar" dest="build/maven-ant-tasks.jar"/>
+
+  <input
+    message="Which provider would you like to use (ec2, cloudservers, vcloud, terremark, rimuhosting)?"
+    validargs="ec2,cloudservers,vcloud,trmk-ecloud,trmk-vcloudexpress,eucalyptus,bluelock-vcdirector,gogrid,rimuhosting"
+    addproperty="provider"
+  />
+
+  <input
+    message="Which driver does ${provider} use?"
+    validargs="aws,rackspace,vcloud,bluelock,gogrid,terremark,ibmdev,rimuhosting"
+    addproperty="driver"
+  />
+
+  <path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks.jar" />
+  <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
+
+  <artifact:localRepository id="local.repository" path="${user.home}/.m2/repository" />
+  <artifact:remoteRepository id="jclouds.repository" url="http://jclouds.googlecode.com/svn/repo" />
+  <artifact:remoteRepository id="jclouds-snapshot.repository" url="https://oss.sonatype.org/content/repositories/snapshots" />
+
+  <artifact:dependencies pathId="jclouds.classpath">
+    <dependency groupId="org.jclouds" artifactId="jclouds-antcontrib" version="${jclouds.version}" />
+    <dependency groupId="org.jclouds" artifactId="jclouds-${driver}" version="${jclouds.version}" />
+    <localRepository refid="local.repository" />
+    <remoteRepository refid="jclouds.repository" />
+    <remoteRepository refid="jclouds-snapshot.repository" />
+  </artifact:dependencies>
+
+  <typedef name="compute" classname="org.jclouds.tools.ant.taskdefs.compute.ComputeTask" classpathref="jclouds.classpath" />
+
+  <input
+    message="What is your identity on ${provider}?"
+    addproperty="identity"
+  />
+
+  <input
+    message="What is the credential for ${identity}?"
+    addproperty="credential"
+  />
+
+  <property name="jclouds.compute.url" value="compute://${identity}:${credential}@${provider}" />
+
+  <target name="list" description="list the identity of all nodes">
+    <compute actions="list" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="list-details" description="list the details of all nodes">
+    <compute actions="list-details" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="list-images" description="list the images supported">
+    <compute actions="list-images" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="list-hardwares" description="list the hardwares supported">
+    <compute actions="list-sizes" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="list-locations" description="list the locations supported">
+    <compute actions="list-locations" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="dump" description="list all information we can obtain about the cloud">
+    <compute actions="list-locations,list-sizes,list-images,list-details" provider="${jclouds.compute.url}" />
+  </target>
+
+  <target name="reboot" depends="reboot-id,reboot-tag" />
+
+  <target name="reboot-id" description="reboot the node ${id}" unless="tag">
+
+    <input
+      message="Which node do you wish to reboot"
+      addproperty="id"
+    />
+
+    <compute actions="reboot" provider="${jclouds.compute.url}">
+      <nodes id="${id}" />
+    </compute>
+  </target>
+
+  <target name="reboot-tag" description="reboot the nodes with tag ${tag}" unless="id" >
+
+    <input
+      message="Which tag do you wish to reboot"
+      addproperty="tag"
+    />
+
+    <compute actions="reboot" provider="${jclouds.compute.url}">
+      <nodes tag="${tag}" />
+    </compute>
+  </target>
+
+  <target name="destroy" depends="destroy-id,destroy-tag" />
+
+  <target name="destroy-id" description="destroy the node ${id}" unless="tag">
+
+    <input
+      message="Which node do you wish to destroy"
+      addproperty="id"
+    />
+
+    <compute actions="destroy" provider="${jclouds.compute.url}">
+      <nodes id="${id}" />
+    </compute>
+  </target>
+
+  <target name="destroy-tag" description="destroy the nodes with tag ${tag}" unless="id" >
+
+    <input
+      message="Which tag do you wish to destroy"
+      addproperty="tag"
+    />
+
+    <compute actions="destroy" provider="${jclouds.compute.url}">
+      <nodes tag="${tag}" />
+    </compute>
+  </target>
+
+  <target name="get" depends="get-tag,get-id" />
+
+  <target name="get-id" description="get the node ${id}" unless="tag">
+
+    <input
+      message="Which node do you wish to get"
+      addproperty="id"
+    />
+
+    <compute actions="get" provider="${jclouds.compute.url}">
+      <nodes id="${id}" />
+    </compute>
+  </target>
+
+  <target name="get-tag" description="get the nodes with tag ${tag}" unless="id" >
+
+    <input
+      message="Which tag do you wish to get"
+      addproperty="tag"
+    />
+
+    <compute actions="get" provider="${jclouds.compute.url}">
+      <nodes tag="${tag}" />
+    </compute>
+  </target>
+
+  <property name="location" value="" />
+  <target name="create" description="create the node ${tag}">
+    <property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />
+    <property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />
+    <property name="os" value="UBUNTU" />
+    <property name="count" value="1" />
+
+    <input
+      message="What do you want to tag your nodes with?"
+      addproperty="tag"
+    />
+
+    <compute actions="create" provider="${jclouds.compute.url}">
+      <nodes privatekeyfile="${privatekeyfile}" publickeyfile="${publickeyfile}" tag="${tag}" count="${count}" os="${os}" hardware="SMALLEST" hostproperty="host" usernameproperty="username" passwordproperty="password" />
+    </compute>
+  </target>
+
+</project>
\ No newline at end of file
diff --git a/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/sshjava/SSHJava.java b/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/sshjava/SSHJava.java
index aaaced9..1faf3ee 100644
--- a/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/sshjava/SSHJava.java
+++ b/tools/antcontrib/src/main/java/org/jclouds/tools/ant/taskdefs/sshjava/SSHJava.java
@@ -1,588 +1,588 @@
-/**

- *

- * Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>

- *

- * ====================================================================

- * 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 org.jclouds.tools.ant.taskdefs.sshjava;

-

-import static com.google.common.base.Preconditions.checkNotNull;

-import static org.jclouds.scriptbuilder.domain.Statements.exec;

-

-import java.io.BufferedWriter;

-import java.io.File;

-import java.io.FileWriter;

-import java.io.IOException;

-import java.security.SecureRandom;

-import java.util.LinkedHashMap;

-import java.util.List;

-import java.util.Map;

-import java.util.Map.Entry;

-import java.util.concurrent.TimeoutException;

-

-import org.apache.tools.ant.BuildException;

-import org.apache.tools.ant.Location;

-import org.apache.tools.ant.Project;

-import org.apache.tools.ant.Target;

-import org.apache.tools.ant.Task;

-import org.apache.tools.ant.taskdefs.Java;

-import org.apache.tools.ant.taskdefs.Replace;

-import org.apache.tools.ant.taskdefs.Replace.Replacefilter;

-import org.apache.tools.ant.taskdefs.optional.ssh.SSHUserInfo;

-import org.apache.tools.ant.taskdefs.optional.ssh.Scp;

-import org.apache.tools.ant.types.CommandlineJava;

-import org.apache.tools.ant.types.Environment;

-import org.apache.tools.ant.types.FileSet;

-import org.apache.tools.ant.types.Path;

-import org.apache.tools.ant.types.Environment.Variable;

-import org.jclouds.scriptbuilder.InitBuilder;

-import org.jclouds.scriptbuilder.domain.OsFamily;

-import org.jclouds.scriptbuilder.domain.ShellToken;

-import org.jclouds.scriptbuilder.domain.Statement;

-import org.jclouds.scriptbuilder.domain.StatementList;

-import org.jclouds.scriptbuilder.domain.Statements;

-import org.jclouds.tools.ant.util.SSHExecute;

-

-import com.google.common.annotations.VisibleForTesting;

-import com.google.common.base.Function;

-import com.google.common.base.Joiner;

-import com.google.common.collect.ImmutableList;

-import com.google.common.collect.Iterables;

-import com.google.common.collect.Lists;

-import com.google.common.collect.Maps;

-import com.jcraft.jsch.JSchException;

-

-/**

- * Version of the Java task that executes over ssh.

- * 

- * @author Adrian Cole

- */

-public class SSHJava extends Java {

-   private final SSHExecute exec;

-   private final Scp scp;

-   private final SSHUserInfo userInfo;

-   private File localDirectory;

-   File remotebase;

-   @VisibleForTesting

-   File remotedir;

-   @VisibleForTesting

-   Environment env = new Environment();

-

-   private OsFamily osFamily = OsFamily.UNIX;

-   private File errorFile;

-   private String errorProperty;

-   private File outputFile;

-   private String outputProperty;

-   String id = "sshjava" + new SecureRandom().nextLong();

-   private boolean append;

-

-   @VisibleForTesting

-   final LinkedHashMap<String, String> shiftMap = Maps.newLinkedHashMap();

-   @VisibleForTesting

-   final LinkedHashMap<String, String> replace = Maps.newLinkedHashMap();

-

-   public SSHJava() {

-      super();

-      exec = new SSHExecute();

-      exec.setProject(getProject());

-      scp = new Scp();

-      userInfo = new SSHUserInfo();

-      scp.init();

-      setFork(true);

-      setTrust(true);

-   }

-

-   public SSHJava(Task owner) {

-      this();

-      bindToOwner(owner);

-   }

-

-   public void setId(String id) {

-      this.id = id;

-   }

-

-   @Override

-   public int executeJava() throws BuildException {

-      checkNotNull(remotebase, "remotebase must be set");

-

-      if (localDirectory == null) {

-         try {

-            localDirectory = File.createTempFile("sshjava", "dir");

-            localDirectory.delete();

-            localDirectory.mkdirs();

-         } catch (IOException e) {

-            throw new BuildException(e);

-         }

-      }

-

-      if (remotedir == null)

-         remotedir = new File(remotebase, id);

-

-      String command = createInitScript(osFamily, id, remotedir.getAbsolutePath(), env, getCommandLine());

-

-      try {

-         BufferedWriter out = new BufferedWriter(new FileWriter(new File(localDirectory, "init."

-                  + ShellToken.SH.to(osFamily))));

-         out.write(command);

-         out.close();

-      } catch (IOException e) {

-         throw new BuildException(e);

-      }

-

-      replaceAllTokensIn(localDirectory);

-

-      FileSet cwd = new FileSet();

-      cwd.setDir(localDirectory);

-      if (osFamily == OsFamily.UNIX) {

-         log("removing old contents: " + remotedir.getAbsolutePath(), Project.MSG_VERBOSE);

-         sshexec(exec("rm -rf " + remotedir.getAbsolutePath()).render(osFamily));

-      } else {

-         // TODO need recursive remove on windows

-      }

-      mkdirAndCopyTo(remotedir.getAbsolutePath(), ImmutableList.of(cwd));

-

-      for (Entry<String, String> entry : shiftMap.entrySet()) {

-         FileSet set = new FileSet();

-         File source = new File(entry.getKey());

-         if (source.isDirectory()) {

-            set.setDir(new File(entry.getKey()));

-            mkdirAndCopyTo(remotebase.getAbsolutePath() + ShellToken.FS.to(osFamily) + entry.getValue(), ImmutableList

-                     .of(set));

-         } else {

-            String destination = remotebase.getAbsolutePath() + ShellToken.FS.to(osFamily)

-                     + new File(entry.getValue()).getParent();

-            sshexec(exec("{md} " + destination).render(osFamily));

-            scp.init();

-            String scpDestination = getScpDir(destination);

-            log("staging: " + scpDestination, Project.MSG_VERBOSE);

-            scp.setFile(source.getAbsolutePath());

-            scp.setTodir(scpDestination);

-            scp.execute();

-         }

-      }

-

-      if (getCommandLine().getClasspath() != null) {

-         copyPathTo(getCommandLine().getClasspath(), remotedir.getAbsolutePath() + "/classpath");

-      }

-

-      if (getCommandLine().getBootclasspath() != null) {

-         copyPathTo(getCommandLine().getBootclasspath(), remotedir.getAbsolutePath() + "/bootclasspath");

-      }

-

-      if (osFamily == OsFamily.UNIX) {

-         sshexec(exec("chmod 755 " + remotedir.getAbsolutePath() + "{fs}init.{sh}").render(osFamily));

-      }

-

-      Statement statement = new StatementList(exec("{cd} " + remotedir.getAbsolutePath()), exec(remotedir

-               .getAbsolutePath()

-               + "{fs}init.{sh} init"), exec(remotedir.getAbsolutePath() + "{fs}init.{sh} run"));

-      try {

-         return sshexecRedirectStreams(statement);

-      } catch (IOException e) {

-         throw new BuildException(e, getLocation());

-      }

-   }

-

-   void replaceAllTokensIn(File directory) {

-      Replace replacer = new Replace();

-      replacer.setProject(getProject());

-      replacer.setDir(directory);

-

-      Map<String, String> map = Maps.newLinkedHashMap();

-      // this has to go first

-      map.put(directory.getAbsolutePath(), remotedir.getAbsolutePath());

-

-      map.putAll(Maps.transformValues(shiftMap, new Function<String, String>() {

-

-         @Override

-         public String apply(String in) {

-            return remotebase + ShellToken.FS.to(osFamily) + in;

-         }

-

-      }));

-      map.putAll(replace);

-

-      for (Entry<String, String> entry : map.entrySet()) {

-         Replacefilter filter = replacer.createReplacefilter();

-         filter.setToken(entry.getKey());

-         filter.setValue(entry.getValue());

-      }

-      replacer.execute();

-   }

-

-   private int sshexec(String command) {

-      try {

-         return exec.execute(command);

-      } catch (JSchException e) {

-         throw new BuildException(e, getLocation());

-      } catch (IOException e) {

-         throw new BuildException(e, getLocation());

-      } catch (TimeoutException e) {

-         throw new BuildException(e, getLocation());

-      }

-   }

-

-   private int sshexecRedirectStreams(Statement statement) throws IOException {

-      exec.setStreamHandler(redirector.createHandler());

-      log("starting java as:\n" + statement.render(osFamily), Project.MSG_VERBOSE);

-      int rc;

-      try {

-         rc = sshexec(statement.render(osFamily));

-      } finally {

-         redirector.complete();

-      }

-      return rc;

-   }

-

-   private void mkdirAndCopyTo(String destination, Iterable<FileSet> sets) {

-      if (Iterables.size(sets) == 0) {

-         log("no content: " + destination, Project.MSG_DEBUG);

-         return;

-      }

-      if (sshexec(exec("test -d " + destination).render(osFamily)) == 0) {// TODO windows

-         log("already created: " + destination, Project.MSG_VERBOSE);

-         return;

-      }

-      sshexec(exec("{md} " + destination).render(osFamily));

-      scp.init();

-      String scpDestination = getScpDir(destination);

-      log("staging: " + scpDestination, Project.MSG_VERBOSE);

-      for (FileSet set : sets)

-         scp.addFileset(set);

-      scp.setTodir(scpDestination);

-      scp.execute();

-   }

-

-   private String getScpDir(String path) {

-      return String.format("%s:%s@%s:%s", userInfo.getName(), userInfo.getKeyfile() == null ? userInfo.getPassword()

-               : userInfo.getPassphrase(), scp.getHost(), path);

-   }

-

-   void resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(Path path, String prefix, StringBuilder destination) {

-      if (path == null)

-         return;

-      String[] paths = path.list();

-      if (paths != null && paths.length > 0) {

-         for (int i = 0; i < paths.length; i++) {

-            log("converting: " + paths[i], Project.MSG_DEBUG);

-            File file = new File(reprefix(paths[i]));

-            if (file.getAbsolutePath().equals(paths[i]) && file.exists() && file.isFile()) {

-               String newPath = prefix + "{fs}" + file.getName();

-               log("adding new: " + newPath, Project.MSG_DEBUG);

-               destination.append("{ps}").append(prefix + "{fs}" + file.getName());

-            } else {

-               // if the file doesn't exist, it is probably a "forward reference" to something that

-               // is already on the remote machine

-               destination.append("{ps}").append(file.getAbsolutePath());

-               log("adding existing: " + file.getAbsolutePath(), Project.MSG_DEBUG);

-            }

-         }

-      }

-   }

-

-   void copyPathTo(Path path, String destination) {

-      List<FileSet> filesets = Lists.newArrayList();

-      if (path.list() != null && path.list().length > 0) {

-         for (String filepath : path.list()) {

-            if (!filepath.equals(reprefix(filepath)))

-               continue;// we've already copied

-            File file = new File(filepath);

-            if (file.exists()) {

-               FileSet fileset = new FileSet();

-               if (file.isFile()) {

-                  fileset.setFile(file);

-               } else {

-                  fileset.setDir(file);

-               }

-               filesets.add(fileset);

-            }

-         }

-      }

-      mkdirAndCopyTo(destination, filesets);

-   }

-

-   String reprefix(String in) {

-      log("comparing: " + in, Project.MSG_DEBUG);

-      for (Entry<String, String> entry : shiftMap.entrySet()) {

-         if (in.startsWith(entry.getKey())) {

-            log("match shift map: " + entry.getKey(), Project.MSG_DEBUG);

-            in = remotebase + ShellToken.FS.to(osFamily) + entry.getValue() + in.substring(entry.getKey().length());

-         }

-      }

-      for (Entry<String, String> entry : replace.entrySet()) {

-         if (in.startsWith(entry.getKey())) {

-            log("match replaceMap: " + entry.getKey(), Project.MSG_DEBUG);

-            in = entry.getValue() + in.substring(entry.getKey().length());

-         }

-      }

-      log("now: " + in, Project.MSG_DEBUG);

-      return in;

-   }

-

-   String createInitScript(OsFamily osFamily, String id, String basedir, Environment env,

-            CommandlineJava commandLine) {

-      Map<String, String> envVariables = Maps.newHashMap();

-      String[] environment = env.getVariables();

-      if (environment != null) {

-         for (int i = 0; i < environment.length; i++) {

-            log("Setting environment variable: " + environment[i], Project.MSG_DEBUG);

-            String[] keyValue = environment[i].split("=");

-            envVariables.put(keyValue[0], keyValue[1]);

-         }

-      }

-      StringBuilder commandBuilder = new StringBuilder(commandLine.getVmCommand().getExecutable());

-      if (commandLine.getBootclasspath() != null) {

-         commandBuilder.append(" -Xbootclasspath:bootclasspath");

-         resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(commandLine.getBootclasspath(),

-                  "bootclasspath", commandBuilder);

-      }

-

-      if (commandLine.getVmCommand().getArguments() != null

-               && commandLine.getVmCommand().getArguments().length > 0) {

-         commandBuilder.append(" ").append(

-                  Joiner.on(' ').join(commandLine.getVmCommand().getArguments()));

-      }

-      commandBuilder.append(" -cp classpath");

-      resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(commandLine.getClasspath(),

-               "classpath", commandBuilder);

-

-      if (commandLine.getSystemProperties() != null

-               && commandLine.getSystemProperties().getVariables() != null

-               && commandLine.getSystemProperties().getVariables().length > 0) {

-         commandBuilder.append(" ").append(

-                  Joiner.on(' ').join(commandLine.getSystemProperties().getVariables()));

-      }

-

-      commandBuilder.append(" ").append(commandLine.getClassname());

-

-      if (commandLine.getJavaCommand().getArguments() != null

-               && commandLine.getJavaCommand().getArguments().length > 0) {

-         commandBuilder.append(" ").append(

-                  Joiner.on(' ').join(commandLine.getJavaCommand().getArguments()));

-      }

-

-      InitBuilder testInitBuilder = new InitBuilder(id, basedir, basedir, envVariables,

-               ImmutableList.<Statement> of(Statements.interpret( commandBuilder.toString())));

-      return testInitBuilder.render(osFamily);

-   }

-

-   @Override

-   public void addEnv(Environment.Variable var) {

-      env.addVariable(var);

-   }

-

-   /**

-    * Note that if the {@code dir} property is set, this will be copied recursively to the remote

-    * host.

-    */

-   @Override

-   public void setDir(File localDir) {

-      this.localDirectory = checkNotNull(localDir, "dir");

-   }

-

-   /**

-    * All files transfered to the host will be relative to this. The java process itself will be at

-    * this path/{@code id}.

-    */

-   public void setRemotebase(File remotebase) {

-      this.remotebase = checkNotNull(remotebase, "remotebase");

-   }

-

-   @Override

-   public void setFork(boolean fork) {

-      if (!fork)

-         throw new IllegalArgumentException("this only operates when fork is set");

-   }

-

-   /**

-    * Remote host, either DNS name or IP.

-    * 

-    * @param host

-    *           The new host value

-    */

-   public void setHost(String host) {

-      exec.setHost(host);

-      scp.setHost(host);

-   }

-

-   /**

-    * Username known to remote host.

-    * 

-    * @param username

-    *           The new username value

-    */

-   public void setUsername(String username) {

-      exec.setUsername(username);

-      scp.setUsername(username);

-      userInfo.setName(username);

-   }

-

-   /**

-    * Sets the password for the user.

-    * 

-    * @param password

-    *           The new password value

-    */

-   public void setPassword(String password) {

-      exec.setPassword(password);

-      scp.setPassword(password);

-      userInfo.setPassword(password);

-   }

-

-   /**

-    * Sets the keyfile for the user.

-    * 

-    * @param keyfile

-    *           The new keyfile value

-    */

-   public void setKeyfile(String keyfile) {

-      exec.setKeyfile(keyfile);

-      scp.setKeyfile(keyfile);

-      userInfo.setKeyfile(keyfile);

-      if (userInfo.getPassphrase() == null)

-         userInfo.setPassphrase("");

-   }

-

-   /**

-    * Sets the passphrase for the users key.

-    * 

-    * @param passphrase

-    *           The new passphrase value

-    */

-   public void setPassphrase(String passphrase) {

-      exec.setPassphrase(passphrase);

-      scp.setPassphrase(passphrase);

-      userInfo.setPassphrase(passphrase);

-   }

-

-   /**

-    * Sets the path to the file that has the identities of all known hosts. This is used by SSH

-    * protocol to validate the identity of the host. The default is

-    * <i>${user.home}/.ssh/known_hosts</i>.

-    * 

-    * @param knownHosts

-    *           a path to the known hosts file.

-    */

-   public void setKnownhosts(String knownHosts) {

-      exec.setKnownhosts(knownHosts);

-      scp.setKnownhosts(knownHosts);

-   }

-

-   /**

-    * Setting this to true trusts hosts whose identity is unknown.

-    * 

-    * @param yesOrNo

-    *           if true trust the identity of unknown hosts.

-    */

-   public void setTrust(boolean yesOrNo) {

-      exec.setTrust(yesOrNo);

-      scp.setTrust(yesOrNo);

-      userInfo.setTrust(yesOrNo);

-   }

-

-   /**

-    * Changes the port used to connect to the remote host.

-    * 

-    * @param port

-    *           port number of remote host.

-    */

-   public void setPort(int port) {

-      exec.setPort(port);

-      scp.setPort(port);

-   }

-

-   /**

-    * The connection can be dropped after a specified number of milliseconds. This is sometimes

-    * useful when a connection may be flaky. Default is 0, which means &quot;wait forever&quot;.

-    * 

-    * @param timeout

-    *           The new timeout value in seconds

-    */

-   public void setTimeout(long timeout) {

-      exec.setTimeout(timeout);

-   }

-

-   @Override

-   public void setProject(Project project) {

-      super.setProject(project);

-      exec.setProject(project);

-      scp.setProject(project);

-   }

-

-   @Override

-   public void setOwningTarget(Target target) {

-      super.setOwningTarget(target);

-      scp.setOwningTarget(target);

-   }

-

-   @Override

-   public void setTaskName(String taskName) {

-      super.setTaskName(taskName);

-      scp.setTaskName(taskName);

-   }

-

-   @Override

-   public void setDescription(String description) {

-      super.setDescription(description);

-      scp.setDescription(description);

-   }

-

-   @Override

-   public void setLocation(Location location) {

-      super.setLocation(location);

-      scp.setLocation(location);

-   }

-

-   @Override

-   public void setTaskType(String type) {

-      super.setTaskType(type);

-      scp.setTaskType(type);

-   }

-

-   @Override

-   public String toString() {

-      return "SSHJava [append=" + append + ", env=" + env + ", errorFile=" + errorFile + ", errorProperty="

-               + errorProperty + ", localDirectory=" + localDirectory + ", osFamily=" + osFamily + ", outputFile="

-               + outputFile + ", outputProperty=" + outputProperty + ", remoteDirectory=" + remotebase + ", userInfo="

-               + userInfo + "]";

-   }

-

-   @Override

-   public void addSysproperty(Variable sysp) {

-      if (sysp.getKey().startsWith("sshjava.shift.")) {

-         shiftMap.put(sysp.getKey().replaceFirst("sshjava.shift.", ""), sysp.getValue());

-      } else if (sysp.getKey().startsWith("sshjava.replace.")) {

-         replace.put(sysp.getKey().replaceFirst("sshjava.replace.", ""), sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.id")) {

-         setId(sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.host")) {

-         setHost(sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.port") && !sysp.getValue().equals("")) {

-         setPort(Integer.parseInt(sysp.getValue()));

-      } else if (sysp.getKey().equals("sshjava.username")) {

-         setUsername(sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.password") && !sysp.getValue().equals("")) {

-         setPassword(sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.keyfile") && !sysp.getValue().equals("")) {

-         setKeyfile(sysp.getValue());

-      } else if (sysp.getKey().equals("sshjava.remotebase")) {

-         setRemotebase(new File(sysp.getValue()));

-      } else {

-         super.addSysproperty(sysp);

-      }

-   }

-

-}

+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
+ *
+ * ====================================================================
+ * 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 org.jclouds.tools.ant.taskdefs.sshjava;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.scriptbuilder.domain.Statements.exec;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.security.SecureRandom;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Location;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.taskdefs.Replace;
+import org.apache.tools.ant.taskdefs.Replace.Replacefilter;
+import org.apache.tools.ant.taskdefs.optional.ssh.SSHUserInfo;
+import org.apache.tools.ant.taskdefs.optional.ssh.Scp;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Environment.Variable;
+import org.jclouds.scriptbuilder.InitBuilder;
+import org.jclouds.scriptbuilder.domain.OsFamily;
+import org.jclouds.scriptbuilder.domain.ShellToken;
+import org.jclouds.scriptbuilder.domain.Statement;
+import org.jclouds.scriptbuilder.domain.StatementList;
+import org.jclouds.scriptbuilder.domain.Statements;
+import org.jclouds.tools.ant.util.SSHExecute;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jcraft.jsch.JSchException;
+
+/**
+ * Version of the Java task that executes over ssh.
+ * 
+ * @author Adrian Cole
+ */
+public class SSHJava extends Java {
+   private final SSHExecute exec;
+   private final Scp scp;
+   private final SSHUserInfo userInfo;
+   private File localDirectory;
+   File remotebase;
+   @VisibleForTesting
+   File remotedir;
+   @VisibleForTesting
+   Environment env = new Environment();
+
+   private OsFamily osFamily = OsFamily.UNIX;
+   private File errorFile;
+   private String errorProperty;
+   private File outputFile;
+   private String outputProperty;
+   String id = "sshjava" + new SecureRandom().nextLong();
+   private boolean append;
+
+   @VisibleForTesting
+   final LinkedHashMap<String, String> shiftMap = Maps.newLinkedHashMap();
+   @VisibleForTesting
+   final LinkedHashMap<String, String> replace = Maps.newLinkedHashMap();
+
+   public SSHJava() {
+      super();
+      exec = new SSHExecute();
+      exec.setProject(getProject());
+      scp = new Scp();
+      userInfo = new SSHUserInfo();
+      scp.init();
+      setFork(true);
+      setTrust(true);
+   }
+
+   public SSHJava(Task owner) {
+      this();
+      bindToOwner(owner);
+   }
+
+   public void setId(String id) {
+      this.id = id;
+   }
+
+   @Override
+   public int executeJava() throws BuildException {
+      checkNotNull(remotebase, "remotebase must be set");
+
+      if (localDirectory == null) {
+         try {
+            localDirectory = File.createTempFile("sshjava", "dir");
+            localDirectory.delete();
+            localDirectory.mkdirs();
+         } catch (IOException e) {
+            throw new BuildException(e);
+         }
+      }
+
+      if (remotedir == null)
+         remotedir = new File(remotebase, id);
+
+      String command = createInitScript(osFamily, id, remotedir.getAbsolutePath(), env, getCommandLine());
+
+      try {
+         BufferedWriter out = new BufferedWriter(new FileWriter(new File(localDirectory, "init."
+                  + ShellToken.SH.to(osFamily))));
+         out.write(command);
+         out.close();
+      } catch (IOException e) {
+         throw new BuildException(e);
+      }
+
+      replaceAllTokensIn(localDirectory);
+
+      FileSet cwd = new FileSet();
+      cwd.setDir(localDirectory);
+      if (osFamily == OsFamily.UNIX) {
+         log("removing old contents: " + remotedir.getAbsolutePath(), Project.MSG_VERBOSE);
+         sshexec(exec("rm -rf " + remotedir.getAbsolutePath()).render(osFamily));
+      } else {
+         // TODO need recursive remove on windows
+      }
+      mkdirAndCopyTo(remotedir.getAbsolutePath(), ImmutableList.of(cwd));
+
+      for (Entry<String, String> entry : shiftMap.entrySet()) {
+         FileSet set = new FileSet();
+         File source = new File(entry.getKey());
+         if (source.isDirectory()) {
+            set.setDir(new File(entry.getKey()));
+            mkdirAndCopyTo(remotebase.getAbsolutePath() + ShellToken.FS.to(osFamily) + entry.getValue(), ImmutableList
+                     .of(set));
+         } else {
+            String destination = remotebase.getAbsolutePath() + ShellToken.FS.to(osFamily)
+                     + new File(entry.getValue()).getParent();
+            sshexec(exec("{md} " + destination).render(osFamily));
+            scp.init();
+            String scpDestination = getScpDir(destination);
+            log("staging: " + scpDestination, Project.MSG_VERBOSE);
+            scp.setFile(source.getAbsolutePath());
+            scp.setTodir(scpDestination);
+            scp.execute();
+         }
+      }
+
+      if (getCommandLine().getClasspath() != null) {
+         copyPathTo(getCommandLine().getClasspath(), remotedir.getAbsolutePath() + "/classpath");
+      }
+
+      if (getCommandLine().getBootclasspath() != null) {
+         copyPathTo(getCommandLine().getBootclasspath(), remotedir.getAbsolutePath() + "/bootclasspath");
+      }
+
+      if (osFamily == OsFamily.UNIX) {
+         sshexec(exec("chmod 755 " + remotedir.getAbsolutePath() + "{fs}init.{sh}").render(osFamily));
+      }
+
+      Statement statement = new StatementList(exec("{cd} " + remotedir.getAbsolutePath()), exec(remotedir
+               .getAbsolutePath()
+               + "{fs}init.{sh} init"), exec(remotedir.getAbsolutePath() + "{fs}init.{sh} run"));
+      try {
+         return sshexecRedirectStreams(statement);
+      } catch (IOException e) {
+         throw new BuildException(e, getLocation());
+      }
+   }
+
+   void replaceAllTokensIn(File directory) {
+      Replace replacer = new Replace();
+      replacer.setProject(getProject());
+      replacer.setDir(directory);
+
+      Map<String, String> map = Maps.newLinkedHashMap();
+      // this has to go first
+      map.put(directory.getAbsolutePath(), remotedir.getAbsolutePath());
+
+      map.putAll(Maps.transformValues(shiftMap, new Function<String, String>() {
+
+         @Override
+         public String apply(String in) {
+            return remotebase + ShellToken.FS.to(osFamily) + in;
+         }
+
+      }));
+      map.putAll(replace);
+
+      for (Entry<String, String> entry : map.entrySet()) {
+         Replacefilter filter = replacer.createReplacefilter();
+         filter.setToken(entry.getKey());
+         filter.setValue(entry.getValue());
+      }
+      replacer.execute();
+   }
+
+   private int sshexec(String command) {
+      try {
+         return exec.execute(command);
+      } catch (JSchException e) {
+         throw new BuildException(e, getLocation());
+      } catch (IOException e) {
+         throw new BuildException(e, getLocation());
+      } catch (TimeoutException e) {
+         throw new BuildException(e, getLocation());
+      }
+   }
+
+   private int sshexecRedirectStreams(Statement statement) throws IOException {
+      exec.setStreamHandler(redirector.createHandler());
+      log("starting java as:\n" + statement.render(osFamily), Project.MSG_VERBOSE);
+      int rc;
+      try {
+         rc = sshexec(statement.render(osFamily));
+      } finally {
+         redirector.complete();
+      }
+      return rc;
+   }
+
+   private void mkdirAndCopyTo(String destination, Iterable<FileSet> sets) {
+      if (Iterables.size(sets) == 0) {
+         log("no content: " + destination, Project.MSG_DEBUG);
+         return;
+      }
+      if (sshexec(exec("test -d " + destination).render(osFamily)) == 0) {// TODO windows
+         log("already created: " + destination, Project.MSG_VERBOSE);
+         return;
+      }
+      sshexec(exec("{md} " + destination).render(osFamily));
+      scp.init();
+      String scpDestination = getScpDir(destination);
+      log("staging: " + scpDestination, Project.MSG_VERBOSE);
+      for (FileSet set : sets)
+         scp.addFileset(set);
+      scp.setTodir(scpDestination);
+      scp.execute();
+   }
+
+   private String getScpDir(String path) {
+      return String.format("%s:%s@%s:%s", userInfo.getName(), userInfo.getKeyfile() == null ? userInfo.getPassword()
+               : userInfo.getPassphrase(), scp.getHost(), path);
+   }
+
+   void resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(Path path, String prefix, StringBuilder destination) {
+      if (path == null)
+         return;
+      String[] paths = path.list();
+      if (paths != null && paths.length > 0) {
+         for (int i = 0; i < paths.length; i++) {
+            log("converting: " + paths[i], Project.MSG_DEBUG);
+            File file = new File(reprefix(paths[i]));
+            if (file.getAbsolutePath().equals(paths[i]) && file.exists() && file.isFile()) {
+               String newPath = prefix + "{fs}" + file.getName();
+               log("adding new: " + newPath, Project.MSG_DEBUG);
+               destination.append("{ps}").append(prefix + "{fs}" + file.getName());
+            } else {
+               // if the file doesn't exist, it is probably a "forward reference" to something that
+               // is already on the remote machine
+               destination.append("{ps}").append(file.getAbsolutePath());
+               log("adding existing: " + file.getAbsolutePath(), Project.MSG_DEBUG);
+            }
+         }
+      }
+   }
+
+   void copyPathTo(Path path, String destination) {
+      List<FileSet> filesets = Lists.newArrayList();
+      if (path.list() != null && path.list().length > 0) {
+         for (String filepath : path.list()) {
+            if (!filepath.equals(reprefix(filepath)))
+               continue;// we've already copied
+            File file = new File(filepath);
+            if (file.exists()) {
+               FileSet fileset = new FileSet();
+               if (file.isFile()) {
+                  fileset.setFile(file);
+               } else {
+                  fileset.setDir(file);
+               }
+               filesets.add(fileset);
+            }
+         }
+      }
+      mkdirAndCopyTo(destination, filesets);
+   }
+
+   String reprefix(String in) {
+      log("comparing: " + in, Project.MSG_DEBUG);
+      for (Entry<String, String> entry : shiftMap.entrySet()) {
+         if (in.startsWith(entry.getKey())) {
+            log("match shift map: " + entry.getKey(), Project.MSG_DEBUG);
+            in = remotebase + ShellToken.FS.to(osFamily) + entry.getValue() + in.substring(entry.getKey().length());
+         }
+      }
+      for (Entry<String, String> entry : replace.entrySet()) {
+         if (in.startsWith(entry.getKey())) {
+            log("match replaceMap: " + entry.getKey(), Project.MSG_DEBUG);
+            in = entry.getValue() + in.substring(entry.getKey().length());
+         }
+      }
+      log("now: " + in, Project.MSG_DEBUG);
+      return in;
+   }
+
+   String createInitScript(OsFamily osFamily, String id, String basedir, Environment env,
+            CommandlineJava commandLine) {
+      Map<String, String> envVariables = Maps.newHashMap();
+      String[] environment = env.getVariables();
+      if (environment != null) {
+         for (int i = 0; i < environment.length; i++) {
+            log("Setting environment variable: " + environment[i], Project.MSG_DEBUG);
+            String[] keyValue = environment[i].split("=");
+            envVariables.put(keyValue[0], keyValue[1]);
+         }
+      }
+      StringBuilder commandBuilder = new StringBuilder(commandLine.getVmCommand().getExecutable());
+      if (commandLine.getBootclasspath() != null) {
+         commandBuilder.append(" -Xbootclasspath:bootclasspath");
+         resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(commandLine.getBootclasspath(),
+                  "bootclasspath", commandBuilder);
+      }
+
+      if (commandLine.getVmCommand().getArguments() != null
+               && commandLine.getVmCommand().getArguments().length > 0) {
+         commandBuilder.append(" ").append(
+                  Joiner.on(' ').join(commandLine.getVmCommand().getArguments()));
+      }
+      commandBuilder.append(" -cp classpath");
+      resetPathToUnderPrefixIfExistsAndIsFileIfNotExistsAddAsIs(commandLine.getClasspath(),
+               "classpath", commandBuilder);
+
+      if (commandLine.getSystemProperties() != null
+               && commandLine.getSystemProperties().getVariables() != null
+               && commandLine.getSystemProperties().getVariables().length > 0) {
+         commandBuilder.append(" ").append(
+                  Joiner.on(' ').join(commandLine.getSystemProperties().getVariables()));
+      }
+
+      commandBuilder.append(" ").append(commandLine.getClassname());
+
+      if (commandLine.getJavaCommand().getArguments() != null
+               && commandLine.getJavaCommand().getArguments().length > 0) {
+         commandBuilder.append(" ").append(
+                  Joiner.on(' ').join(commandLine.getJavaCommand().getArguments()));
+      }
+
+      InitBuilder testInitBuilder = new InitBuilder(id, basedir, basedir, envVariables,
+               ImmutableList.<Statement> of(Statements.interpret( commandBuilder.toString())));
+      return testInitBuilder.render(osFamily);
+   }
+
+   @Override
+   public void addEnv(Environment.Variable var) {
+      env.addVariable(var);
+   }
+
+   /**
+    * Note that if the {@code dir} property is set, this will be copied recursively to the remote
+    * host.
+    */
+   @Override
+   public void setDir(File localDir) {
+      this.localDirectory = checkNotNull(localDir, "dir");
+   }
+
+   /**
+    * All files transfered to the host will be relative to this. The java process itself will be at
+    * this path/{@code id}.
+    */
+   public void setRemotebase(File remotebase) {
+      this.remotebase = checkNotNull(remotebase, "remotebase");
+   }
+
+   @Override
+   public void setFork(boolean fork) {
+      if (!fork)
+         throw new IllegalArgumentException("this only operates when fork is set");
+   }
+
+   /**
+    * Remote host, either DNS name or IP.
+    * 
+    * @param host
+    *           The new host value
+    */
+   public void setHost(String host) {
+      exec.setHost(host);
+      scp.setHost(host);
+   }
+
+   /**
+    * Username known to remote host.
+    * 
+    * @param username
+    *           The new username value
+    */
+   public void setUsername(String username) {
+      exec.setUsername(username);
+      scp.setUsername(username);
+      userInfo.setName(username);
+   }
+
+   /**
+    * Sets the password for the user.
+    * 
+    * @param password
+    *           The new password value
+    */
+   public void setPassword(String password) {
+      exec.setPassword(password);
+      scp.setPassword(password);
+      userInfo.setPassword(password);
+   }
+
+   /**
+    * Sets the keyfile for the user.
+    * 
+    * @param keyfile
+    *           The new keyfile value
+    */
+   public void setKeyfile(String keyfile) {
+      exec.setKeyfile(keyfile);
+      scp.setKeyfile(keyfile);
+      userInfo.setKeyfile(keyfile);
+      if (userInfo.getPassphrase() == null)
+         userInfo.setPassphrase("");
+   }
+
+   /**
+    * Sets the passphrase for the users key.
+    * 
+    * @param passphrase
+    *           The new passphrase value
+    */
+   public void setPassphrase(String passphrase) {
+      exec.setPassphrase(passphrase);
+      scp.setPassphrase(passphrase);
+      userInfo.setPassphrase(passphrase);
+   }
+
+   /**
+    * Sets the path to the file that has the identities of all known hosts. This is used by SSH
+    * protocol to validate the identity of the host. The default is
+    * <i>${user.home}/.ssh/known_hosts</i>.
+    * 
+    * @param knownHosts
+    *           a path to the known hosts file.
+    */
+   public void setKnownhosts(String knownHosts) {
+      exec.setKnownhosts(knownHosts);
+      scp.setKnownhosts(knownHosts);
+   }
+
+   /**
+    * Setting this to true trusts hosts whose identity is unknown.
+    * 
+    * @param yesOrNo
+    *           if true trust the identity of unknown hosts.
+    */
+   public void setTrust(boolean yesOrNo) {
+      exec.setTrust(yesOrNo);
+      scp.setTrust(yesOrNo);
+      userInfo.setTrust(yesOrNo);
+   }
+
+   /**
+    * Changes the port used to connect to the remote host.
+    * 
+    * @param port
+    *           port number of remote host.
+    */
+   public void setPort(int port) {
+      exec.setPort(port);
+      scp.setPort(port);
+   }
+
+   /**
+    * The connection can be dropped after a specified number of milliseconds. This is sometimes
+    * useful when a connection may be flaky. Default is 0, which means &quot;wait forever&quot;.
+    * 
+    * @param timeout
+    *           The new timeout value in seconds
+    */
+   public void setTimeout(long timeout) {
+      exec.setTimeout(timeout);
+   }
+
+   @Override
+   public void setProject(Project project) {
+      super.setProject(project);
+      exec.setProject(project);
+      scp.setProject(project);
+   }
+
+   @Override
+   public void setOwningTarget(Target target) {
+      super.setOwningTarget(target);
+      scp.setOwningTarget(target);
+   }
+
+   @Override
+   public void setTaskName(String taskName) {
+      super.setTaskName(taskName);
+      scp.setTaskName(taskName);
+   }
+
+   @Override
+   public void setDescription(String description) {
+      super.setDescription(description);
+      scp.setDescription(description);
+   }
+
+   @Override
+   public void setLocation(Location location) {
+      super.setLocation(location);
+      scp.setLocation(location);
+   }
+
+   @Override
+   public void setTaskType(String type) {
+      super.setTaskType(type);
+      scp.setTaskType(type);
+   }
+
+   @Override
+   public String toString() {
+      return "SSHJava [append=" + append + ", env=" + env + ", errorFile=" + errorFile + ", errorProperty="
+               + errorProperty + ", localDirectory=" + localDirectory + ", osFamily=" + osFamily + ", outputFile="
+               + outputFile + ", outputProperty=" + outputProperty + ", remoteDirectory=" + remotebase + ", userInfo="
+               + userInfo + "]";
+   }
+
+   @Override
+   public void addSysproperty(Variable sysp) {
+      if (sysp.getKey().startsWith("sshjava.shift.")) {
+         shiftMap.put(sysp.getKey().replaceFirst("sshjava.shift.", ""), sysp.getValue());
+      } else if (sysp.getKey().startsWith("sshjava.replace.")) {
+         replace.put(sysp.getKey().replaceFirst("sshjava.replace.", ""), sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.id")) {
+         setId(sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.host")) {
+         setHost(sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.port") && !sysp.getValue().equals("")) {
+         setPort(Integer.parseInt(sysp.getValue()));
+      } else if (sysp.getKey().equals("sshjava.username")) {
+         setUsername(sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.password") && !sysp.getValue().equals("")) {
+         setPassword(sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.keyfile") && !sysp.getValue().equals("")) {
+         setKeyfile(sysp.getValue());
+      } else if (sysp.getKey().equals("sshjava.remotebase")) {
+         setRemotebase(new File(sysp.getValue()));
+      } else {
+         super.addSysproperty(sysp);
+      }
+   }
+
+}
\ No newline at end of file