Hi, Thomas.
I'd recommend starting with jclouds-examples on github. You'll blobstore-basics, which you can play around with. Syntax looks ok. If you run into errors, pls paste them!
-A
--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.
BlobStore blobStore; Properties properties = new Properties(); // Set where to save the blobs String baseDir = System.getProperty("user.home") + "/localblobstore"; properties.setProperty(FilesystemConstants.PROPERTY_BASEDIR, baseDir); properties.setProperty("jclouds.credential", ""); blobStoreFilesystem = new BlobStoreContextFactory(). createContext(provider, properties). getBlobStore();
Blob.getPayload() has the contents you are looking for.
you can try Strings2.toStringAndClose(Blob.getPayload().getInput()) or
various other inputstream options!
-A
You're right, the blobstore guide [1] doesn't go into a lot of detail
on this, although there is a small bit at the end.
Have a look at, for example, the FileUploader exercise, especially things like
byte[] payloadRead = ByteStreams.toByteArray(
store.getBlob(containerName, filename).get().getPayload().getInput());
In general, Payload [3, 4] is your friend ;-)
Hope this helps!
ap
[1] http://www.jclouds.org/documentation/userguide/blobstore-guide
[2]
https://github.com/demobox/jclouds-cloud-storage-workshop/blob/master/exercise3/src/main/java/org/jclouds/labs/blobstore/exercise3/FileUploader.java
[3]
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/io/Payload.java
[4]
http://demobox.github.com/jclouds-maven-site-1.4.0/1.4.0/jclouds-multi/apidocs/index.html?org/jclouds/io/Payload.html