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 ;
21+ import static com .google .gcloud .storage .Blob .BlobSourceOption .toSourceOptions ;
2222import static com .google .gcloud .storage .Blob .BlobSourceOption .toGetOptions ;
2323
2424import com .google .common .base .Function ;
@@ -58,7 +58,7 @@ private BlobSourceOption(StorageRpc.Option rpcOption) {
5858 super (rpcOption , null );
5959 }
6060
61- private Storage .BlobSourceOption convert (BlobInfo blobInfo ) {
61+ private Storage .BlobSourceOption toSourceOptions (BlobInfo blobInfo ) {
6262 switch (rpcOption ()) {
6363 case IF_GENERATION_MATCH :
6464 return Storage .BlobSourceOption .generationMatch (blobInfo .generation ());
@@ -104,11 +104,12 @@ public static BlobSourceOption metagenerationNotMatch() {
104104 return new BlobSourceOption (StorageRpc .Option .IF_METAGENERATION_NOT_MATCH );
105105 }
106106
107- static Storage .BlobSourceOption [] convert (BlobInfo blobInfo , BlobSourceOption ... options ) {
107+ static Storage .BlobSourceOption [] toSourceOptions (BlobInfo blobInfo ,
108+ BlobSourceOption ... options ) {
108109 Storage .BlobSourceOption [] convertedOptions = new Storage .BlobSourceOption [options .length ];
109110 int index = 0 ;
110111 for (BlobSourceOption option : options ) {
111- convertedOptions [index ++] = option .convert (blobInfo );
112+ convertedOptions [index ++] = option .toSourceOptions (blobInfo );
112113 }
113114 return convertedOptions ;
114115 }
@@ -126,7 +127,7 @@ static Storage.BlobGetOption[] toGetOptions(BlobInfo blobInfo, BlobSourceOption.
126127 /**
127128 * Constructs a {@code Blob} object for the provided {@code BlobInfo}. The storage service is used
128129 * to issue requests.
129- *
130+ *
130131 * @param storage the storage service used for issuing requests
131132 * @param info blob's info
132133 */
@@ -138,7 +139,7 @@ public Blob(Storage storage, BlobInfo info) {
138139 /**
139140 * Creates a {@code Blob} object for the provided bucket and blob names. Performs an RPC call to
140141 * get the latest blob information.
141- *
142+ *
142143 * @param storage the storage service used for issuing requests
143144 * @param bucket bucket's name
144145 * @param blob blob's name
@@ -152,7 +153,7 @@ public static Blob load(Storage storage, String bucket, String blob) {
152153 /**
153154 * Creates a {@code Blob} object for the provided {@code blobId}. Performs an RPC call to get the
154155 * latest blob information.
155- *
156+ *
156157 * @param storage the storage service used for issuing requests
157158 * @param blobId blob's identifier
158159 * @return the {@code Blob} object or {@code null} if not found.
@@ -253,7 +254,7 @@ public Blob update(BlobInfo blobInfo, BlobTargetOption... options) {
253254 */
254255 public CopyWriter copyTo (BlobId targetBlob , BlobSourceOption ... options ) {
255256 CopyRequest copyRequest = CopyRequest .builder ().source (info .bucket (), info .name ())
256- .sourceOptions (convert (info , options )).target (targetBlob ).build ();
257+ .sourceOptions (toSourceOptions (info , options )).target (targetBlob ).build ();
257258 return storage .copy (copyRequest );
258259 }
259260
@@ -265,7 +266,7 @@ public CopyWriter copyTo(BlobId targetBlob, BlobSourceOption... options) {
265266 * @throws StorageException upon failure
266267 */
267268 public boolean delete (BlobSourceOption ... options ) {
268- return storage .delete (info .blobId (), convert (info , options ));
269+ return storage .delete (info .blobId (), toSourceOptions (info , options ));
269270 }
270271
271272 /**
@@ -304,7 +305,7 @@ public CopyWriter copyTo(String targetBucket, String targetBlob, BlobSourceOptio
304305 * @throws StorageException upon failure
305306 */
306307 public BlobReadChannel reader (BlobSourceOption ... options ) {
307- return storage .reader (info .blobId (), convert (info , options ));
308+ return storage .reader (info .blobId (), toSourceOptions (info , options ));
308309 }
309310
310311 /**
0 commit comments