File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
gcloud-java-storage/src/main/java/com/google/gcloud/storage Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 3030
3131/**
3232 * A Google cloud storage object.
33+ *
34+ * <p>
35+ * Objects of this class are immutable. Operations that modify the blob like {@link #update} and
36+ * {@link #copyTo} return a new object. To get a {@code Blob} object with the most recent
37+ * information use {@link #reload}.
38+ * </p>
3339 */
3440public final class Blob {
3541
@@ -151,7 +157,10 @@ public Blob reload(BlobSourceOption... options) {
151157 /**
152158 * Update the blob's information. Bucket or blob's name cannot be changed by this method. If you
153159 * want to rename the blob or move it to a different bucket use the {@link #copyTo} and
154- * {@link #delete} operations. A new {@code Blob} object is returned.
160+ * {@link #delete} operations. A new {@code Blob} object is returned. By default no checks are
161+ * made on the metadata generation of the current blob. If you want to update the information only
162+ * if the current blob metadata are at their latest version use the {@code metagenerationMatch}
163+ * option: {@code blob.update(newInfo, BlobTargetOption.metagenerationMatch()}.
155164 *
156165 * @param blobInfo new blob's information. Bucket and blob names must match the current ones
157166 * @param options update options
Original file line number Diff line number Diff line change 3131
3232/**
3333 * A Google cloud storage bucket.
34+ *
35+ * <p>
36+ * Objects of this class are immutable. Operations that modify the bucket like {@link #update}
37+ * return a new object. To get a {@code Bucket} object with the most recent information use
38+ * {@link #reload}.
39+ * </p>
3440 */
3541public final class Bucket {
3642
@@ -91,7 +97,10 @@ public Bucket reload(BucketSourceOption... options) {
9197
9298 /**
9399 * Update the bucket's information. Bucket's name cannot be changed. A new {@code Bucket} object
94- * is returned.
100+ * is returned. By default no checks are made on the metadata generation of the current bucket.
101+ * If you want to update the information only if the current bucket metadata are at their latest
102+ * version use the {@code metagenerationMatch} option:
103+ * {@code bucket.update(newInfo, BucketTargetOption.metagenerationMatch());}
95104 *
96105 * @param bucketInfo new bucket's information. Name must match the one of the current bucket
97106 * @param options update options
You can’t perform that action at this time.
0 commit comments