Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Properties overrides = new Properties();
- overrides.setProperty(Constants.PROPERTY_ENDPOINT, CLOUD_SERVIE_ENDPOINT);
- // get a context with nova that offers the portable ComputeService api
- BlobStoreContext context = new BlobStoreContextFactory().createContext("aws-s3", ident,
- password, ImmutableSet.<Module> of(), overrides);
- Properties overrides = new Properties();
- overrides.setProperty("swift.endpoint", "http://1.1.1.1:8080/auth");
- BlobStoreContext context = new BlobStoreContextFactory().createContext("swift", "XXXXXX:YYYYY", "password", ImmutableSet.<Module> of(), overrides);
- import static org.jclouds.s3.reference.S3Constants.PROPERTY_S3_VIRTUAL_HOST_BUCKETS;
- ...
- Properties overrides = new Properties();
- overrides.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false");
- BlobStore blobstore = ContextBuilder.newBuilder(new S3ApiMetadata()) // or "s3"
- .endpoint("http://host:port")
- .credentials(accessKey, secretKey)
- .overrides(overrides)
- .buildView(BlobStoreContext.class).getBlobStore();
- import static org.jclouds.s3.reference.S3Constants.PROPERTY_S3_SERVICE_PATH;
- ...
- overrides.setProperty(PROPERTY_S3_SERVICE_PATH, "/services/Walrus");
- ...
- .endpoint("http://host:port/services/Walrus")
- String username = "test:tester";
- String password = "testing";
- Properties overrides = new Properties();
- overrides.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false");
- BlobStoreContext context = ContextBuilder.newBuilder(new S3ApiMetadata())
- .endpoint("http://myserver:8080")
- .credentials(username, password)
- .overrides(overrides)
- .buildView(BlobStoreContext.class);
- BlobStore blobStore = context.getBlobStore();
- String bucket="public";
- blobStore.containerExists(bucket);
- System.out.println("bucket exist "+ bucket);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement