@@ -190,6 +190,16 @@ public Blob reload(BlobSourceOption... options) {
190190 * made on the metadata generation of the current blob. If you want to update the information only
191191 * if the current blob metadata are at their latest version use the {@code metagenerationMatch}
192192 * option: {@code blob.update(newInfo, BlobTargetOption.metagenerationMatch())}.
193+ * <p>
194+ * Original metadata are merged with metadata in the provided {@code blobInfo}. To replace
195+ * metadata instead you first have to unset them. Unsetting metadata can be done by setting the
196+ * provided {@code blobInfo}'s metadata to {@code null}.
197+ * </p>
198+ * <p>
199+ * Example usage of replacing blob's metadata:
200+ * <pre> {@code blob.update(blob.info().toBuilder().metadata(null).build());}
201+ * {@code blob.update(blob.info().toBuilder().metadata(newMetadata).build());}
202+ * </pre>
193203 *
194204 * @param blobInfo new blob's information. Bucket and blob names must match the current ones
195205 * @param options update options
@@ -306,8 +316,7 @@ public Storage storage() {
306316 }
307317
308318 /**
309- * Gets the requested blobs. If {@code infos.length == 0} an empty list is returned. If
310- * {@code infos.length > 1} a batch request is used to fetch blobs.
319+ * Gets the requested blobs. A batch request is used to fetch blobs.
311320 *
312321 * @param storage the storage service used to issue the request
313322 * @param blobs the blobs to get
@@ -331,8 +340,12 @@ public Blob apply(BlobInfo f) {
331340 }
332341
333342 /**
334- * Updates the requested blobs. If {@code infos.length == 0} an empty list is returned. If
335- * {@code infos.length > 1} a batch request is used to update blobs.
343+ * Updates the requested blobs. A batch request is used to update blobs. Original metadata are
344+ * merged with metadata in the provided {@code BlobInfo} objects. To replace metadata instead
345+ * you first have to unset them. Unsetting metadata can be done by setting the provided
346+ * {@code BlobInfo} objects metadata to {@code null}. See
347+ * {@link #update(com.google.gcloud.storage.BlobInfo,
348+ * com.google.gcloud.storage.Storage.BlobTargetOption...) } for a code example.
336349 *
337350 * @param storage the storage service used to issue the request
338351 * @param infos the blobs to update
@@ -356,8 +369,7 @@ public Blob apply(BlobInfo f) {
356369 }
357370
358371 /**
359- * Deletes the requested blobs. If {@code infos.length == 0} an empty list is returned. If
360- * {@code infos.length > 1} a batch request is used to delete blobs.
372+ * Deletes the requested blobs. A batch request is used to delete blobs.
361373 *
362374 * @param storage the storage service used to issue the request
363375 * @param blobs the blobs to delete
0 commit comments