From 090a336e35a2a59539fae8b363007660ca982a43 Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Tue, 5 Sep 2017 17:46:17 -0700 Subject: [PATCH] Fix suggested change (#840) #839 --- storage/json-api/src/main/java/StorageSample.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/storage/json-api/src/main/java/StorageSample.java b/storage/json-api/src/main/java/StorageSample.java index 474efc17292..048d6e284f3 100644 --- a/storage/json-api/src/main/java/StorageSample.java +++ b/storage/json-api/src/main/java/StorageSample.java @@ -54,11 +54,10 @@ public static List listBucket(String bucketName) Storage.Objects.List listRequest = client.objects().list(bucketName); List results = new ArrayList(); - Objects objects; // Iterate through each page of results, and add them to our results list. do { - objects = listRequest.execute(); + Objects objects = listRequest.execute(); // Add the items in this page of results to the list we'll return. results.addAll(objects.getItems()); @@ -165,7 +164,6 @@ public static void main(String[] args) { System.out.println(object.getName() + " (" + object.getSize() + " bytes)"); } - // Create a temp file to upload Path tempPath = Files.createTempFile("StorageSample", "txt"); Files.write(tempPath, "Sample file".getBytes());