3939/**
4040 * A Google cloud storage object.
4141 *
42- * <p>
43- * Objects of this class are immutable. Operations that modify the blob like {@link #update} and
42+ * <p>Objects of this class are immutable. Operations that modify the blob like {@link #update} and
4443 * {@link #copyTo} return a new object. To get a {@code Blob} object with the most recent
4544 * information use {@link #reload}.
4645 * </p>
@@ -239,13 +238,13 @@ public Blob reload(BlobSourceOption... options) {
239238 * made on the metadata generation of the current blob. If you want to update the information only
240239 * if the current blob metadata are at their latest version use the {@code metagenerationMatch}
241240 * option: {@code blob.update(newInfo, BlobTargetOption.metagenerationMatch())}.
242- * <p>
243- * Original metadata are merged with metadata in the provided {@code blobInfo}. To replace
241+ *
242+ * <p> Original metadata are merged with metadata in the provided {@code blobInfo}. To replace
244243 * metadata instead you first have to unset them. Unsetting metadata can be done by setting the
245244 * provided {@code blobInfo}'s metadata to {@code null}.
246245 * </p>
247- * <p>
248- * Example usage of replacing blob's metadata:
246+ *
247+ * <p> Example usage of replacing blob's metadata:
249248 * <pre> {@code blob.update(blob.info().toBuilder().metadata(null).build());}
250249 * {@code blob.update(blob.info().toBuilder().metadata(newMetadata).build());}
251250 * </pre>
@@ -261,6 +260,17 @@ public Blob update(BlobInfo blobInfo, BlobTargetOption... options) {
261260 return new Blob (storage , storage .update (blobInfo , options ));
262261 }
263262
263+ /**
264+ * Deletes this blob.
265+ *
266+ * @param options blob delete options
267+ * @return {@code true} if blob was deleted, {@code false} if it was not found
268+ * @throws StorageException upon failure
269+ */
270+ public boolean delete (BlobSourceOption ... options ) {
271+ return storage .delete (info .blobId (), toSourceOptions (info , options ));
272+ }
273+
264274 /**
265275 * Sends a copy request for the current blob to the target blob. Possibly also some of the
266276 * metadata are copied (e.g. content-type).
@@ -277,17 +287,6 @@ public CopyWriter copyTo(BlobId targetBlob, BlobSourceOption... options) {
277287 return storage .copy (copyRequest );
278288 }
279289
280- /**
281- * Deletes this blob.
282- *
283- * @param options blob delete options
284- * @return {@code true} if blob was deleted, {@code false} if it was not found
285- * @throws StorageException upon failure
286- */
287- public boolean delete (BlobSourceOption ... options ) {
288- return storage .delete (info .blobId (), toSourceOptions (info , options ));
289- }
290-
291290 /**
292291 * Sends a copy request for the current blob to the target bucket, preserving its name. Possibly
293292 * copying also some of the metadata (e.g. content-type).
@@ -381,8 +380,8 @@ public static List<Blob> get(final Storage storage, BlobId... blobs) {
381380 return Collections .unmodifiableList (Lists .transform (storage .get (blobs ),
382381 new Function <BlobInfo , Blob >() {
383382 @ Override
384- public Blob apply (BlobInfo f ) {
385- return f != null ? new Blob (storage , f ) : null ;
383+ public Blob apply (BlobInfo blobInfo ) {
384+ return blobInfo != null ? new Blob (storage , blobInfo ) : null ;
386385 }
387386 }));
388387 }
@@ -410,8 +409,8 @@ public static List<Blob> update(final Storage storage, BlobInfo... infos) {
410409 return Collections .unmodifiableList (Lists .transform (storage .update (infos ),
411410 new Function <BlobInfo , Blob >() {
412411 @ Override
413- public Blob apply (BlobInfo f ) {
414- return f != null ? new Blob (storage , f ) : null ;
412+ public Blob apply (BlobInfo blobInfo ) {
413+ return blobInfo != null ? new Blob (storage , blobInfo ) : null ;
415414 }
416415 }));
417416 }
0 commit comments