jclouds-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [2/4] jclouds git commit: JCLOUDS-1452: Replace size with contentLength
Date Tue, 01 Jan 2019 03:42:15 GMT
JCLOUDS-1452: Replace size with contentLength

Tracking B2 v2 API changes.


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/750809f9
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/750809f9
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/750809f9

Branch: refs/heads/master
Commit: 750809f97f12bbaf7e8afcd83107a3c268e21244
Parents: ce163f3
Author: Andrew Gaul <gaul@apache.org>
Authored: Fri Sep 28 12:04:42 2018 -0700
Committer: Andrew Gaul <gaul@apache.org>
Committed: Mon Dec 31 18:47:38 2018 -0800

----------------------------------------------------------------------
 .../main/java/org/jclouds/b2/blobstore/B2BlobStore.java |  4 ++--
 .../main/java/org/jclouds/b2/domain/B2ObjectList.java   | 12 ++++++++----
 .../b2/src/test/resources/list_file_names_response.json |  4 ++--
 .../src/test/resources/list_file_versions_response.json |  6 +++---
 4 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/750809f9/providers/b2/src/main/java/org/jclouds/b2/blobstore/B2BlobStore.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/blobstore/B2BlobStore.java b/providers/b2/src/main/java/org/jclouds/b2/blobstore/B2BlobStore.java
index c36773f..7fec40a 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/blobstore/B2BlobStore.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/blobstore/B2BlobStore.java
@@ -205,9 +205,9 @@ public final class B2BlobStore extends BaseBlobStore {
          } else {
             Map<String, String> userMetadata = ImmutableMap.of();
             ContentMetadata metadata = ContentMetadataBuilder.create()
-                  .contentLength(entry.size())
+                  .contentLength(entry.contentLength())
                   .build();
-            builder.add(new BlobMetadataImpl(null, entry.fileName(), null, null, null, null,
entry.uploadTimestamp(), userMetadata, null, container, metadata, entry.size()));
+            builder.add(new BlobMetadataImpl(null, entry.fileName(), null, null, null, null,
entry.uploadTimestamp(), userMetadata, null, container, metadata, entry.contentLength()));
          }
       }
       return new PageSetImpl<StorageMetadata>(builder.build(), list.nextFileName());

http://git-wip-us.apache.org/repos/asf/jclouds/blob/750809f9/providers/b2/src/main/java/org/jclouds/b2/domain/B2ObjectList.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/domain/B2ObjectList.java b/providers/b2/src/main/java/org/jclouds/b2/domain/B2ObjectList.java
index af256dd..78c9f43 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/domain/B2ObjectList.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/domain/B2ObjectList.java
@@ -41,12 +41,16 @@ public abstract class B2ObjectList {
       public abstract Action action();
       @Nullable public abstract String fileId();
       public abstract String fileName();
-      public abstract long size();
+      public abstract long contentLength();
+      @Deprecated
+      public long size() {
+         return contentLength();
+      }
       public abstract Date uploadTimestamp();
 
-      @SerializedNames({"action", "fileId", "fileName", "size", "uploadTimestamp"})
-      public static Entry create(Action action, @Nullable String fileId, String fileName,
long size, long uploadTimestamp) {
-         return new AutoValue_B2ObjectList_Entry(action, fileId, fileName, size, new Date(uploadTimestamp));
+      @SerializedNames({"action", "fileId", "fileName", "contentLength", "uploadTimestamp"})
+      public static Entry create(Action action, @Nullable String fileId, String fileName,
long contentLength, long uploadTimestamp) {
+         return new AutoValue_B2ObjectList_Entry(action, fileId, fileName, contentLength,
new Date(uploadTimestamp));
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/750809f9/providers/b2/src/test/resources/list_file_names_response.json
----------------------------------------------------------------------
diff --git a/providers/b2/src/test/resources/list_file_names_response.json b/providers/b2/src/test/resources/list_file_names_response.json
index 51d95ba..b26e7b3 100644
--- a/providers/b2/src/test/resources/list_file_names_response.json
+++ b/providers/b2/src/test/resources/list_file_names_response.json
@@ -4,14 +4,14 @@
             "action": "upload",
             "fileId": "4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6b_d20150809_m012853_c100_v0009990_t0000",
             "fileName": "files/hello.txt",
-            "size": 6,
+            "contentLength": 6,
             "uploadTimestamp": 1439083733000
         },
         {
             "action": "upload",
             "fileId": "4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6c_d20150809_m012854_c100_v0009990_t0000",
             "fileName": "files/world.txt",
-            "size": 6,
+            "contentLength": 6,
             "uploadTimestamp": 1439083734000
         }
     ],

http://git-wip-us.apache.org/repos/asf/jclouds/blob/750809f9/providers/b2/src/test/resources/list_file_versions_response.json
----------------------------------------------------------------------
diff --git a/providers/b2/src/test/resources/list_file_versions_response.json b/providers/b2/src/test/resources/list_file_versions_response.json
index e7aaf48..2c87afa 100644
--- a/providers/b2/src/test/resources/list_file_versions_response.json
+++ b/providers/b2/src/test/resources/list_file_versions_response.json
@@ -4,21 +4,21 @@
             "action": "upload",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886245_d20150809_m232316_c100_v0009990_t0003",
             "fileName": "files/hello.txt",
-            "size": 6,
+            "contentLength": 6,
             "uploadTimestamp": 1439162596000
         },
         {
             "action": "hide",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886247_d20150809_m232323_c100_v0009990_t0005",
             "fileName": "files/world.txt",
-            "size": 0,
+            "contentLength": 0,
             "uploadTimestamp": 1439162603000
         },
         {
             "action": "upload",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886246_d20150809_m232316_c100_v0009990_t0003",
             "fileName": "files/world.txt",
-            "size": 6,
+            "contentLength": 6,
             "uploadTimestamp": 1439162596000
         }
     ],


Mime
View raw message