jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)
Date Thu, 24 Nov 2016 18:20:51 GMT
andrewgaul requested changes on this pull request.



> @@ -138,6 +154,10 @@ public static void main(String[] args) throws IOException {
          }
          
       } finally {
+         // delete cointainer
+         if (blobStore.containerExists(containerName)) {

Should be OK to remove `containerExists`.

>  
       // Init
-      BlobStoreContext context = ContextBuilder.newBuilder(provider)
-                                               .credentials(identity, credential)
-                                               .buildView(BlobStoreContext.class);
+      ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider)
+              .credentials(identity, credential);
+      if (isSwiftv1) {
+         Properties properties = new Properties();
+         properties.setProperty("jclouds.keystone.credential-type", "tempAuthCredentials");

I don't want to bikeshed over this but using properties throughout might be more obvious.
 OK to use `true`/`false` as well.

>           Location location = null;
          if (apiMetadata instanceof SwiftApiMetadata) {
             location = Iterables.getFirst(blobStore.listAssignableLocations(), null);
          }
-         blobStore.createContainerInLocation(location, containerName);
+         blobStore.createContainerInLocation(null, containerName);

Would be nice to have a property for location.

> @@ -69,35 +73,47 @@
 
    public static void main(String[] args) throws IOException {
 
-      if (args.length < PARAMETERS)
+      String provider;
+      String identity;
+      String credential;
+      String containerName;
+      String endpoint = null;
+      boolean isSwiftv1 = Boolean.FALSE;
+      
+      List<String> parameters = Lists.newArrayList(args);
+      if (parameters.size() < PARAMETERS)
          throw new IllegalArgumentException(INVALID_SYNTAX);

Update `INVALID_SYNTAX` with new arguments.

> @@ -69,35 +73,47 @@
 
    public static void main(String[] args) throws IOException {
 
-      if (args.length < PARAMETERS)
+      String provider;
+      String identity;
+      String credential;
+      String containerName;
+      String endpoint = null;
+      boolean isSwiftv1 = Boolean.FALSE;
+      
+      List<String> parameters = Lists.newArrayList(args);
+      if (parameters.size() < PARAMETERS)

You can keep this as an array and just use `args.length`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10082299
Mime
View raw message