From ada30747eae02fd73d6fdf7b5fd0eec11623b1ac Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Mon, 4 Jan 2010 00:44:15 +0000 Subject: [PATCH] made demo more readable git-svn-id: http://jclouds.googlecode.com/svn/trunk@2590 3d8758e0-26b5-11de-8745-db77d3ebf521 --- demos/antjruby/build.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/demos/antjruby/build.xml b/demos/antjruby/build.xml index 6e25b24eb3..4d6f058323 100644 --- a/demos/antjruby/build.xml +++ b/demos/antjruby/build.xml @@ -109,16 +109,22 @@ class ShrinkBlob < Task end def execute - # correct the classloader so that extensions can be found + # correct the ant classloader so that extensions can be found java.lang.Thread.currentThread().setContextClassLoader(ServiceExtensionLoader.new().getClass().getClassLoader()) + print "creating the archive from ",@dir,"\n" zipStream = Archives.create(@zip, ZipExporter.java_class).as(ExplodedImporter.java_class).importDirectory(@dir).as(ZipExporter.java_class).exportZip() + destination = HttpUtils.createUri(@blobstore) print "connecting to service ",destination.getHost(),"/",@container,"\n" + + # array thing is a weird hack since jruby doesn't understand varargs context = BlobStoreContextFactory.new().createContext(destination, java.lang.reflect.Array.newInstance(com.google.inject.Module.java_class,0)) context.getBlobStore().createContainer(@container) + print "uploading to ",destination.getHost(),"/",@container,"/",@zip,"\n" context.createInputStreamMap(@container).put(@zip,zipStream); + context.close(); end end