Skip to content

Commit 1855ae1

Browse files
committed
Add better javadoc to Storage.copy and CopyWriter
1 parent 3e5db7a commit 1855ae1

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

gcloud-java-storage/src/main/java/com/google/gcloud/storage/CopyWriter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
import java.util.concurrent.Callable;
3333

3434
/**
35-
* Google Storage blob copy writer. This class holds the result of a copy request. If source and
35+
* Google Storage blob copy writer. A {@code CopyWriter} object allows to copy both blob's data and
36+
* information. To override source blob's information call {@link Storage#copy(Storage.CopyRequest)}
37+
* with a {@code CopyRequest} object where the copy target is set via
38+
* {@link Storage.CopyRequest.Builder#target(BlobInfo, Storage.BlobTargetOption...)} or
39+
* {@link Storage.CopyRequest.Builder#target(BlobInfo, Iterable)}.
40+
*
41+
* <p>This class holds the result of a copy request. If source and
3642
* destination blobs share the same location and storage class the copy is completed in one RPC call
3743
* otherwise one or more {@link #copyChunk} calls are necessary to complete the copy. In addition,
3844
* {@link CopyWriter#result()} can be used to automatically complete the copy and return information

gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,12 +1385,17 @@ public static Builder builder() {
13851385
Blob compose(ComposeRequest composeRequest);
13861386

13871387
/**
1388-
* Sends a copy request. Returns a {@link CopyWriter} object for the provided
1389-
* {@code CopyRequest}. If source and destination objects share the same location and storage
1390-
* class the source blob is copied with one request and {@link CopyWriter#result()} immediately
1391-
* returns, regardless of the {@link CopyRequest#megabytesCopiedPerChunk} parameter.
1392-
* If source and destination have different location or storage class {@link CopyWriter#result()}
1393-
* might issue multiple RPC calls depending on blob's size.
1388+
* Sends a copy request. This method copies both blob's data and information. To override source
1389+
* blob's information set the copy target via
1390+
* {@link CopyRequest.Builder#target(BlobInfo, BlobTargetOption...)} or
1391+
* {@link CopyRequest.Builder#target(BlobInfo, Iterable)}.
1392+
*
1393+
* <p>This method returns a {@link CopyWriter} object for the provided {@code CopyRequest}. If
1394+
* source and destination objects share the same location and storage class the source blob is
1395+
* copied with one request and {@link CopyWriter#result()} immediately returns, regardless of the
1396+
* {@link CopyRequest#megabytesCopiedPerChunk} parameter. If source and destination have different
1397+
* location or storage class {@link CopyWriter#result()} might issue multiple RPC calls depending
1398+
* on blob's size.
13941399
*
13951400
* <p>Example usage of copy:
13961401
* <pre> {@code BlobInfo blob = service.copy(copyRequest).result();}

0 commit comments

Comments
 (0)