> + * Demonstrates use of BlobStore filesystem api
> + * @author adisesha
> + */
> +object Main extends App {
> + require(args.length == 1, "Invalid number of parameters. Syntax is:
> \"basedirectory\" ")
> +
> + val baseDir = args(0)
> +
> + //Base directory property
> + val properties = new java.util.Properties()
> + properties.setProperty(FilesystemConstants.PROPERTY_BASEDIR, baseDir)
> +
> + //Using scala-arm for context management. See
> https://github.com/jsuereth/scala-arm
> + managed(ContextBuilder.newBuilder("filesystem")
> + .overrides(properties)
> + .buildView(classOf[BlobStoreContext])).acquireFor(context => {
Use `acquireAndGet` (since we're not using the `Either` return type of
`acquireFor`) as in the example on the [usage
page](http://jsuereth.com/scala-arm/usage.html)?
```
managed(ContextBuilder.newBuilder("filesystem").overrides(properties).buildView(classOf[BlobStoreContext]))
acquireAndGet {
context =>
...
}
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/4/files#r4583977