> +
> + public static B2Object create(String fileName, String contentSha1,
> Map<String, String> fileInfo, @Nullable Payload payload) {
> + return createResponse(null, fileName, contentSha1, fileInfo, payload,
> null);
> + }
> +
> + /** Create a response to a request. Most external callers should call
> create. */
> + public static B2Object createResponse(@Nullable String fileId, String
> fileName, String contentSha1, Map<String, String> fileInfo, @Nullable Payload
> payload, @Nullable Date uploadTimestamp) {
> + Preconditions.checkArgument(contentSha1.length() ==
> Hashing.sha1().bits() / 4,
> + "Expected hash length of %s, was: %s", Hashing.sha1().bits() /
> 4, contentSha1.length());
> + return new AutoValue_B2Object(fileId, fileName, contentSha1, fileInfo,
> payload, uploadTimestamp, null, null, null, null, null);
> + }
> +
> + @SerializedNames({"fileId", "fileName", "accountId", "bucketId",
> "contentLength", "contentSha1", "contentType", "fileInfo", "action",
> "uploadTimestamp", "payload"})
> + public static B2Object createHeadResponse(String fileId, String fileName,
> String accountId, String bucketId, long contentLength, String contentSha1,
> String contentType, Map<String, String> fileInfo, Action action, long
> uploadTimestamp, @Nullable Payload payload) {
> + return new AutoValue_B2Object(fileId, fileName, contentSha1, fileInfo,
> null, new Date(uploadTimestamp), action, accountId, bucketId, contentLength,
> contentType);
> + }
Done.
---
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-labs/pull/276/files/d27eef19e1ef39d560170786aa7a9ef1f711b71b#r65822774