jclouds-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [4/4] jclouds git commit: JCLOUDS-1452: Add new v2 fields
Date Tue, 01 Jan 2019 03:42:17 GMT
JCLOUDS-1452: Add new v2 fields

Some of these only give consistency with similar requests.


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

Branch: refs/heads/master
Commit: 9524383e49c9d202d5cc81979337855dc056f41e
Parents: a0f496e
Author: Andrew Gaul <gaul@apache.org>
Authored: Fri Sep 28 13:55:10 2018 -0700
Committer: Andrew Gaul <gaul@apache.org>
Committed: Mon Dec 31 19:39:37 2018 -0800

----------------------------------------------------------------------
 .../b2/src/main/java/org/jclouds/b2/domain/Action.java  |  1 +
 .../main/java/org/jclouds/b2/domain/B2ObjectList.java   |  8 +++++---
 .../java/org/jclouds/b2/domain/HideFileResponse.java    |  8 +++++---
 .../b2/domain/ListUnfinishedLargeFilesResponse.java     | 12 +++++++++---
 .../org/jclouds/b2/domain/MultipartUploadResponse.java  |  8 +++++---
 providers/b2/src/test/resources/hide_file_response.json |  2 ++
 .../b2/src/test/resources/list_file_names_response.json |  4 ++++
 .../src/test/resources/list_file_versions_response.json |  6 ++++++
 .../resources/list_unfinished_large_files_response.json |  1 +
 .../src/test/resources/start_large_file_response.json   |  3 +++
 10 files changed, 41 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/main/java/org/jclouds/b2/domain/Action.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/domain/Action.java b/providers/b2/src/main/java/org/jclouds/b2/domain/Action.java
index 3dd6e44..9a3f27c 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/domain/Action.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/domain/Action.java
@@ -19,6 +19,7 @@ package org.jclouds.b2.domain;
 import com.google.common.base.CaseFormat;
 
 public enum Action {
+   START,
    FOLDER,
    UPLOAD,
    HIDE;

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/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 78c9f43..e45a8e7 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
@@ -39,6 +39,8 @@ public abstract class B2ObjectList {
    @AutoValue
    public abstract static class Entry {
       public abstract Action action();
+      public abstract String accountId();
+      public abstract String bucketId();
       @Nullable public abstract String fileId();
       public abstract String fileName();
       public abstract long contentLength();
@@ -48,9 +50,9 @@ public abstract class B2ObjectList {
       }
       public abstract 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));
+      @SerializedNames({"action", "accountId", "bucketId", "fileId", "fileName", "contentLength",
"uploadTimestamp"})
+      public static Entry create(Action action, String accountId, String bucketId, @Nullable
String fileId, String fileName, long contentLength, long uploadTimestamp) {
+         return new AutoValue_B2ObjectList_Entry(action, accountId, bucketId, fileId, fileName,
contentLength, new Date(uploadTimestamp));
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/main/java/org/jclouds/b2/domain/HideFileResponse.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/domain/HideFileResponse.java b/providers/b2/src/main/java/org/jclouds/b2/domain/HideFileResponse.java
index d7e5e11..d9f8eec 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/domain/HideFileResponse.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/domain/HideFileResponse.java
@@ -26,12 +26,14 @@ import com.google.auto.value.AutoValue;
 public abstract class HideFileResponse {
    /** Always "hide". */
    public abstract Action action();
+   public abstract String accountId();
+   public abstract String bucketId();
    public abstract String fileId();
    public abstract String fileName();
    public abstract Date uploadTimestamp();
 
-   @SerializedNames({"action", "fileId", "fileName", "uploadTimestamp"})
-   public static HideFileResponse create(Action action, String fileId, String fileName, long
uploadTimestamp) {
-      return new AutoValue_HideFileResponse(action, fileId, fileName, new Date(uploadTimestamp));
+   @SerializedNames({"action", "accountId", "bucketId", "fileId", "fileName", "uploadTimestamp"})
+   public static HideFileResponse create(Action action, String accountId, String bucketId,
String fileId, String fileName, long uploadTimestamp) {
+      return new AutoValue_HideFileResponse(action, accountId, bucketId, fileId, fileName,
new Date(uploadTimestamp));
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/main/java/org/jclouds/b2/domain/ListUnfinishedLargeFilesResponse.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/domain/ListUnfinishedLargeFilesResponse.java
b/providers/b2/src/main/java/org/jclouds/b2/domain/ListUnfinishedLargeFilesResponse.java
index 986fd63..10406e2 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/domain/ListUnfinishedLargeFilesResponse.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/domain/ListUnfinishedLargeFilesResponse.java
@@ -40,16 +40,22 @@ public abstract class ListUnfinishedLargeFilesResponse {
    @AutoValue
    public abstract static class Entry {
       public abstract String accountId();
+      /** Always "upload". */
+      public abstract Action action();
       public abstract String bucketId();
+      /** Always null. */
+      @Nullable public abstract Long contentLength();
+      /** Always null. */
+      @Nullable public abstract String contentSha1();
       public abstract String contentType();
       public abstract String fileId();
       public abstract Map<String, String> fileInfo();
       public abstract String fileName();
       public abstract Date uploadTimestamp();
 
-      @SerializedNames({"accountId", "bucketId", "contentType", "fileId", "fileInfo", "fileName",
"uploadTimestamp"})
-      public static Entry create(String accountId, String bucketId, String contentType, String
fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp) {
-         return new AutoValue_ListUnfinishedLargeFilesResponse_Entry(accountId, bucketId,
contentType, fileId, ImmutableMap.copyOf(fileInfo), fileName, new Date(uploadTimestamp));
+      @SerializedNames({"accountId", "action", "bucketId", "contentLength", "contentSha1",
"contentType", "fileId", "fileInfo", "fileName", "uploadTimestamp"})
+      public static Entry create(String accountId, Action action, String bucketId, @Nullable
Long contentLength, @Nullable String contentSha1, String contentType, String fileId, Map<String,
String> fileInfo, String fileName, long uploadTimestamp) {
+         return new AutoValue_ListUnfinishedLargeFilesResponse_Entry(accountId, action, bucketId,
contentLength, contentSha1, contentType, fileId, ImmutableMap.copyOf(fileInfo), fileName,
new Date(uploadTimestamp));
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/main/java/org/jclouds/b2/domain/MultipartUploadResponse.java
----------------------------------------------------------------------
diff --git a/providers/b2/src/main/java/org/jclouds/b2/domain/MultipartUploadResponse.java
b/providers/b2/src/main/java/org/jclouds/b2/domain/MultipartUploadResponse.java
index bfd1dfe..aa08a6f 100644
--- a/providers/b2/src/main/java/org/jclouds/b2/domain/MultipartUploadResponse.java
+++ b/providers/b2/src/main/java/org/jclouds/b2/domain/MultipartUploadResponse.java
@@ -26,6 +26,8 @@ import com.google.common.collect.ImmutableMap;
 
 @AutoValue
 public abstract class MultipartUploadResponse {
+   /** Always "upload". */
+   public abstract Action action();
    public abstract String accountId();
    public abstract String bucketId();
    public abstract String contentType();
@@ -34,8 +36,8 @@ public abstract class MultipartUploadResponse {
    public abstract String fileName();
    public abstract Date uploadTimestamp();
 
-   @SerializedNames({"accountId", "bucketId", "contentType", "fileId", "fileInfo", "fileName",
"uploadTimestamp"})
-   public static MultipartUploadResponse create(String accountId, String bucketId, String
contentType, String fileId, Map<String, String> fileInfo, String fileName, long uploadTimestamp)
{
-      return new AutoValue_MultipartUploadResponse(accountId, bucketId, contentType, fileId,
ImmutableMap.copyOf(fileInfo), fileName, new Date(uploadTimestamp));
+   @SerializedNames({"action", "accountId", "bucketId", "contentType", "fileId", "fileInfo",
"fileName", "uploadTimestamp"})
+   public static MultipartUploadResponse create(Action action, String accountId, String bucketId,
String contentType, String fileId, Map<String, String> fileInfo, String fileName, long
uploadTimestamp) {
+      return new AutoValue_MultipartUploadResponse(action, accountId, bucketId, contentType,
fileId, ImmutableMap.copyOf(fileInfo), fileName, new Date(uploadTimestamp));
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/test/resources/hide_file_response.json
----------------------------------------------------------------------
diff --git a/providers/b2/src/test/resources/hide_file_response.json b/providers/b2/src/test/resources/hide_file_response.json
index 85c6853..3efa5b7 100644
--- a/providers/b2/src/test/resources/hide_file_response.json
+++ b/providers/b2/src/test/resources/hide_file_response.json
@@ -1,5 +1,7 @@
 {
     "action" : "hide",
+    "accountId" : "d522aa47a10f",
+    "bucketId" : "4a48fe8875c6214145260818",
     "fileId" : "4_h4a48fe8875c6214145260818_f000000000000472a_d20140104_m032022_c001_v0000123_t0104",
     "fileName" : "typing_test.txt",
     "uploadTimestamp" : 1437815673000

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/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 b26e7b3..e780019 100644
--- a/providers/b2/src/test/resources/list_file_names_response.json
+++ b/providers/b2/src/test/resources/list_file_names_response.json
@@ -2,6 +2,8 @@
     "files": [
         {
             "action": "upload",
+            "accountId" : "d522aa47a10f",
+            "bucketId" : "4a48fe8875c6214145260818",
             "fileId": "4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6b_d20150809_m012853_c100_v0009990_t0000",
             "fileName": "files/hello.txt",
             "contentLength": 6,
@@ -9,6 +11,8 @@
         },
         {
             "action": "upload",
+            "accountId" : "d522aa47a10f",
+            "bucketId" : "4a48fe8875c6214145260818",
             "fileId": "4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6c_d20150809_m012854_c100_v0009990_t0000",
             "fileName": "files/world.txt",
             "contentLength": 6,

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/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 2c87afa..8af5b02 100644
--- a/providers/b2/src/test/resources/list_file_versions_response.json
+++ b/providers/b2/src/test/resources/list_file_versions_response.json
@@ -2,6 +2,8 @@
     "files": [
         {
             "action": "upload",
+            "accountId" : "d522aa47a10f",
+            "bucketId" : "4a48fe8875c6214145260818",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886245_d20150809_m232316_c100_v0009990_t0003",
             "fileName": "files/hello.txt",
             "contentLength": 6,
@@ -9,6 +11,8 @@
         },
         {
             "action": "hide",
+            "accountId" : "d522aa47a10f",
+            "bucketId" : "4a48fe8875c6214145260818",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886247_d20150809_m232323_c100_v0009990_t0005",
             "fileName": "files/world.txt",
             "contentLength": 0,
@@ -16,6 +20,8 @@
         },
         {
             "action": "upload",
+            "accountId" : "d522aa47a10f",
+            "bucketId" : "4a48fe8875c6214145260818",
             "fileId": "4_z27c88f1d182b150646ff0b16_f100920ddab886246_d20150809_m232316_c100_v0009990_t0003",
             "fileName": "files/world.txt",
             "contentLength": 6,

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/test/resources/list_unfinished_large_files_response.json
----------------------------------------------------------------------
diff --git a/providers/b2/src/test/resources/list_unfinished_large_files_response.json b/providers/b2/src/test/resources/list_unfinished_large_files_response.json
index 753c589..d793067 100644
--- a/providers/b2/src/test/resources/list_unfinished_large_files_response.json
+++ b/providers/b2/src/test/resources/list_unfinished_large_files_response.json
@@ -1,4 +1,5 @@
 {
+    "action": "upload",
     "files": [
         {
             "accountId": "YOUR_ACCOUNT_ID",

http://git-wip-us.apache.org/repos/asf/jclouds/blob/9524383e/providers/b2/src/test/resources/start_large_file_response.json
----------------------------------------------------------------------
diff --git a/providers/b2/src/test/resources/start_large_file_response.json b/providers/b2/src/test/resources/start_large_file_response.json
index 01838b4..3d53737 100644
--- a/providers/b2/src/test/resources/start_large_file_response.json
+++ b/providers/b2/src/test/resources/start_large_file_response.json
@@ -1,6 +1,9 @@
 {
+    "action": "upload",
     "accountId": "YOUR_ACCOUNT_ID",
     "bucketId": "e73ede9c9c8412db49f60715",
+    "contentLength": null,
+    "contentSha1": null,
     "contentType": "b2/x-auto",
     "fileId": "4_za71f544e781e6891531b001a_f200ec353a2184825_d20160409_m004829_c000_v0001016_t0028",
     "fileInfo": {


Mime
View raw message