Skip to content

Commit 76e8be8

Browse files
committed
---
yaml --- r: 6387 b: refs/heads/tswast-patch-1 c: f90e70c h: refs/heads/master i: 6385: 8f73308 6383: 1f24d65
1 parent 7ab9033 commit 76e8be8

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 43460b9d9e01c52368d670119bf3a357e1d607aa
60+
refs/heads/tswast-patch-1: f90e70c4e9784d1d99784d863a5ae2c5ec257985
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,15 @@ public void run(Storage storage, CopyRequest request) {
376376

377377
@Override
378378
CopyRequest parse(String... args) {
379-
if (args.length != 5) {
379+
if (args.length != 4) {
380380
throw new IllegalArgumentException();
381381
}
382-
return CopyRequest.of(args[0], args[1],
383-
BlobInfo.builder(args[2], args[3]).contentType(args[4]).build());
382+
return CopyRequest.of(args[0], args[1], BlobInfo.builder(args[2], args[3]).build());
384383
}
385384

386385
@Override
387386
public String params() {
388-
return "<from_bucket> <from_path> <to_bucket> <to_path> <to_content_type>";
387+
return "<from_bucket> <from_path> <to_bucket> <to_path>";
389388
}
390389
}
391390

branches/tswast-patch-1/gcloud-java-storage/src/main/java/com/google/gcloud/spi/DefaultStorageRpc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ private RewriteResponse rewrite(RewriteRequest req, String token) throws Storage
539539
? req.megabytesRewrittenPerCall * MEGABYTE : null;
540540
com.google.api.services.storage.model.RewriteResponse rewriteReponse = storage.objects()
541541
.rewrite(req.source.getBucket(), req.source.getName(), req.target.getBucket(),
542-
req.target.getName(), req.target)
542+
req.target.getName(), req.target.getContentType() != null ? req.target : null)
543543
.setRewriteToken(token)
544544
.setMaxBytesRewrittenPerCall(maxBytesRewrittenPerCall)
545545
.setProjection(DEFAULT_PROJECTION)

branches/tswast-patch-1/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,16 @@ public static CopyRequest of(BlobId sourceBlobId, BlobInfo target) {
655655
return builder().source(sourceBlobId).target(target).build();
656656
}
657657

658+
public static CopyRequest of(String sourceBucket, String sourceBlob, String targetBlob) {
659+
return of(sourceBucket, sourceBlob,
660+
BlobInfo.builder(BlobId.of(sourceBucket, targetBlob)).build());
661+
}
662+
663+
public static CopyRequest of(BlobId sourceBlobId, String targetBlob) {
664+
return of(sourceBlobId,
665+
BlobInfo.builder(BlobId.of(sourceBlobId.bucket(), targetBlob)).build());
666+
}
667+
658668
public static Builder builder() {
659669
return new Builder();
660670
}

0 commit comments

Comments
 (0)