1818
1919import static com .google .common .base .Preconditions .checkArgument ;
2020import static com .google .common .base .Preconditions .checkNotNull ;
21- import static com .google .gcloud .storage .Blob .BlobSourceOption .convert ;
2221
2322import com .google .gcloud .storage .Storage .BlobSourceOption ;
2423import com .google .gcloud .storage .Storage .BlobTargetOption ;
2524import com .google .gcloud .storage .Storage .BucketSourceOption ;
2625import com .google .gcloud .storage .Storage .BucketTargetOption ;
2726
28- import java .util .LinkedList ;
27+ import java .util .ArrayList ;
2928import java .util .List ;
3029import java .util .Objects ;
3130
@@ -44,7 +43,7 @@ public final class Bucket {
4443 private final BucketInfo info ;
4544
4645 /**
47- * Construct a {@code Bucket} object for the provided {@code BucketInfo}. The storage service is
46+ * Constructs a {@code Bucket} object for the provided {@code BucketInfo}. The storage service is
4847 * used to issue requests.
4948 *
5049 * @param storage the storage service used for issuing requests
@@ -56,7 +55,7 @@ public Bucket(Storage storage, BucketInfo info) {
5655 }
5756
5857 /**
59- * Construct a {@code Bucket} object for the provided name. The storage service is used to issue
58+ * Constructs a {@code Bucket} object for the provided name. The storage service is used to issue
6059 * requests.
6160 *
6261 * @param storage the storage service used for issuing requests
@@ -68,14 +67,14 @@ public Bucket(Storage storage, String bucket) {
6867 }
6968
7069 /**
71- * Return the bucket's information.
70+ * Returns the bucket's information.
7271 */
7372 public BucketInfo info () {
7473 return info ;
7574 }
7675
7776 /**
78- * Check if this bucket exists.
77+ * Checks if this bucket exists.
7978 *
8079 * @return true if this bucket exists, false otherwise
8180 * @throws StorageException upon failure
@@ -96,11 +95,11 @@ public Bucket reload(BucketSourceOption... options) {
9695 }
9796
9897 /**
99- * Update the bucket's information. Bucket's name cannot be changed. A new {@code Bucket} object
98+ * Updates the bucket's information. Bucket's name cannot be changed. A new {@code Bucket} object
10099 * is returned. By default no checks are made on the metadata generation of the current bucket.
101100 * If you want to update the information only if the current bucket metadata are at their latest
102101 * version use the {@code metagenerationMatch} option:
103- * {@code bucket.update(newInfo, BucketTargetOption.metagenerationMatch()); }
102+ * {@code bucket.update(newInfo, BucketTargetOption.metagenerationMatch())}
104103 *
105104 * @param bucketInfo new bucket's information. Name must match the one of the current bucket
106105 * @param options update options
@@ -113,7 +112,7 @@ public Bucket update(BucketInfo bucketInfo, BucketTargetOption... options) {
113112 }
114113
115114 /**
116- * Delete this bucket.
115+ * Deletes this bucket.
117116 *
118117 * @param options bucket delete options
119118 * @return true if bucket was deleted
@@ -124,7 +123,7 @@ public boolean delete(BucketSourceOption... options) {
124123 }
125124
126125 /**
127- * Return the paginated list of {@code Blob} in this bucket.
126+ * Returns the paginated list of {@code Blob} in this bucket.
128127 *
129128 * @param options options for listing blobs
130129 * @throws StorageException upon failure
@@ -134,7 +133,7 @@ public ListResult<Blob> list(Storage.BlobListOption... options) {
134133 }
135134
136135 /**
137- * Return the requested blob in this bucket or {@code null} if not found.
136+ * Returns the requested blob in this bucket or {@code null} if not found.
138137 *
139138 * @param blob name of the requested blob
140139 * @param options blob search options
@@ -145,7 +144,7 @@ public Blob get(String blob, BlobSourceOption... options) {
145144 }
146145
147146 /**
148- * Return a list of requested blobs in this bucket. Blobs that do not exist are null.
147+ * Returns a list of requested blobs in this bucket. Blobs that do not exist are null.
149148 *
150149 * @param blobNames names of the requested blobs
151150 * @throws StorageException upon failure
@@ -155,7 +154,7 @@ public List<Blob> getAll(String... blobNames) {
155154 for (String blobName : blobNames ) {
156155 batch .get (info .name (), blobName );
157156 }
158- List <Blob > blobs = new LinkedList <>();
157+ List <Blob > blobs = new ArrayList <>(blobNames . length );
159158 BatchResponse response = storage .apply (batch .build ());
160159 for (BatchResponse .Result <BlobInfo > result : response .gets ()) {
161160 BlobInfo blobInfo = result .get ();
@@ -165,7 +164,7 @@ public List<Blob> getAll(String... blobNames) {
165164 }
166165
167166 /**
168- * Create a new blob in this bucket.
167+ * Creates a new blob in this bucket.
169168 *
170169 * @param blob a blob name
171170 * @param content the blob content
@@ -179,7 +178,7 @@ Blob create(String blob, byte[] content, BlobTargetOption... options) {
179178 }
180179
181180 /**
182- * Return the bucket's {@code Storage} object used to issue requests.
181+ * Returns the bucket's {@code Storage} object used to issue requests.
183182 */
184183 public Storage storage () {
185184 return storage ;
0 commit comments