jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-examples] BlobStore file system api usage in scala (#4)
Date Tue, 04 Jun 2013 21:46:55 GMT
> +    //Base directory property
> +    val properties=new java.util.Properties()
> +    properties.setProperty(FilesystemConstants.PROPERTY_BASEDIR,baseDir)
> +
> +    val context = ContextBuilder.newBuilder("filesystem")
> +      .overrides(properties)
> +      .buildView(classOf[BlobStoreContext])
> +
> +    try {
> +      val blobStore = context.getBlobStore
> +      blobStore.createContainerInLocation(null, "test")
> +
> +      val blob = blobStore.blobBuilder("test").payload("testdata").build()
> +      blobStore.putBlob("test", blob)
> +
> +      println("File \"test\" stored under,"+baseDir+System.getProperty("file.separator")+"test")

Use `s"..."` instead as it's nicer Scala syntax?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/4/files#r4534165

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message