Skip to content

Commit 8071796

Browse files
committed
---
yaml --- r: 899 b: refs/heads/master c: 86065a7 h: refs/heads/master i: 897: d123a28 895: b92f5a2 v: v3
1 parent 68a677e commit 8071796

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: 82cd3ea7db5e6185094bb41bc586ed6eb8d3cff1
2+
refs/heads/master: 86065a7fc7d130977a40b99b2bf77d6889d84418
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,14 @@ public static Builder builder() {
493493
*/
494494
BucketInfo create(BucketInfo bucketInfo, BucketTargetOption... options);
495495

496+
/**
497+
* Create a new blob with no content.
498+
*
499+
* @return a complete blob information.
500+
* @throws StorageException upon failure
501+
*/
502+
BlobInfo create(BlobInfo blobInfo, BlobTargetOption... options);
503+
496504
/**
497505
* Create a new blob. Direct upload is used to upload {@code content}. For large content,
498506
* {@link #writer} is recommended as it uses resumable upload.
@@ -509,7 +517,7 @@ public static Builder builder() {
509517
* @return a complete blob information.
510518
* @throws StorageException upon failure
511519
*/
512-
BlobInfo createFromStream(BlobInfo blobInfo, InputStream content, BlobTargetOption... options);
520+
BlobInfo create(BlobInfo blobInfo, InputStream content, BlobTargetOption... options);
513521

514522
/**
515523
* Return the requested bucket or {@code null} if not found.

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,19 @@ public com.google.api.services.storage.model.Bucket call() {
114114
}, options().retryParams(), EXCEPTION_HANDLER));
115115
}
116116

117+
@Override
118+
public BlobInfo create(BlobInfo blobInfo, BlobTargetOption... options) {
119+
return create(blobInfo, new ByteArrayInputStream(EMPTY_BYTE_ARRAY), options);
120+
}
121+
117122
@Override
118123
public BlobInfo create(BlobInfo blobInfo, final byte[] content, BlobTargetOption... options) {
119-
return createFromStream(blobInfo,
124+
return create(blobInfo,
120125
new ByteArrayInputStream(firstNonNull(content, EMPTY_BYTE_ARRAY)), options);
121126
}
122127

123128
@Override
124-
public BlobInfo createFromStream(BlobInfo blobInfo, final InputStream content,
129+
public BlobInfo create(BlobInfo blobInfo, final InputStream content,
125130
BlobTargetOption... options) {
126131
final StorageObject blobPb = blobInfo.toPb();
127132
final Map<StorageRpc.Option, ?> optionsMap = optionMap(blobInfo, options);

0 commit comments

Comments
 (0)