File tree Expand file tree Collapse file tree
trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- refs/heads/master: 82cd3ea7db5e6185094bb41bc586ed6eb8d3cff1
2+ refs/heads/master: 86065a7fc7d130977a40b99b2bf77d6889d84418
33refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments