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 c36773f6e4..7fec40a762 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 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(builder.build(), list.nextFileName()); 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 af256dd668..78c9f43f42 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)); } } } 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 51d95ba96e..b26e7b3b69 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 } ], 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 e7aaf48e5c..2c87afa71d 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 } ],