@@ -551,7 +551,7 @@ public Builder sourceOptions(Iterable<BlobSourceOption> options) {
551
551
}
552
552
553
553
/**
554
- * Sets the copy target.
554
+ * Sets the copy target. Target blob information is copied from source.
555
555
*
556
556
* @return the builder.
557
557
*/
@@ -561,8 +561,9 @@ public Builder target(BlobId target) {
561
561
}
562
562
563
563
/**
564
- * Sets the copy target and target options. Copied blob metadata is set to {@code target}.
565
- * This method throws an exception if target blob's content type is {@code null}.
564
+ * Sets the copy target and target options. {@code target} parameter is used to override
565
+ * source blob information (e.g. {@code contentType}, {@code contentLanguage}). {@code
566
+ * target.contentType} is a required field.
566
567
*
567
568
* @return the builder.
568
569
* @throws IllegalArgumentException if {@code target.contentType} is {@code null}
@@ -576,8 +577,9 @@ public Builder target(BlobInfo target, BlobTargetOption... options)
576
577
}
577
578
578
579
/**
579
- * Sets the copy target and target options. Copied blob metadata is set to {@code target}.
580
- * This method throws an exception if target blob's content type is {@code null}.
580
+ * Sets the copy target and target options. {@code target} parameter is used to override
581
+ * source blob information (e.g. {@code contentType}, {@code contentLanguage}). {@code
582
+ * target.contentType} is a required field.
581
583
*
582
584
* @return the builder.
583
585
* @throws IllegalArgumentException if {@code target.contentType} is {@code null}
@@ -658,8 +660,9 @@ public Long megabytesCopiedPerChunk() {
658
660
}
659
661
660
662
/**
661
- * Creates a copy request. Copied blob metadata is set to {@code target}. This method throws an
662
- * exception if target blob's content type is {@code null}.
663
+ * Creates a copy request. {@code target} parameter is used to override source blob information
664
+ * (e.g. {@code contentType}, {@code contentLanguage}). {@code target.contentType} is a required
665
+ * field.
663
666
*
664
667
* @param sourceBucket name of the bucket containing the source blob
665
668
* @param sourceBlob name of the source blob
@@ -674,8 +677,9 @@ public static CopyRequest of(String sourceBucket, String sourceBlob, BlobInfo ta
674
677
}
675
678
676
679
/**
677
- * Creates a copy request. Copied blob metadata is set to {@code target}. This method throws an
678
- * exception if target blob's content type is {@code null}.
680
+ * Creates a copy request. {@code target} parameter is used to override source blob information
681
+ * (e.g. {@code contentType}, {@code contentLanguage}). {@code target.contentType} is a required
682
+ * field.
679
683
*
680
684
* @param sourceBlobId a {@code BlobId} object for the source blob
681
685
* @param target a {@code BlobInfo} object for the target blob
@@ -689,7 +693,7 @@ public static CopyRequest of(BlobId sourceBlobId, BlobInfo target)
689
693
}
690
694
691
695
/**
692
- * Creates a copy request.
696
+ * Creates a copy request. Target blob information is copied from source.
693
697
*
694
698
* @param sourceBucket name of the bucket containing both the source and the target blob
695
699
* @param sourceBlob name of the source blob
@@ -704,7 +708,7 @@ public static CopyRequest of(String sourceBucket, String sourceBlob, String targ
704
708
}
705
709
706
710
/**
707
- * Creates a copy request.
711
+ * Creates a copy request. Target blob information is copied from source.
708
712
*
709
713
* @param sourceBucket name of the bucket containing the source blob
710
714
* @param sourceBlob name of the source blob
@@ -716,7 +720,7 @@ public static CopyRequest of(String sourceBucket, String sourceBlob, BlobId targ
716
720
}
717
721
718
722
/**
719
- * Creates a copy request.
723
+ * Creates a copy request. Target blob information is copied from source.
720
724
*
721
725
* @param sourceBlobId a {@code BlobId} object for the source blob
722
726
* @param targetBlob name of the target blob, in the same bucket of the source blob
@@ -730,7 +734,7 @@ public static CopyRequest of(BlobId sourceBlobId, String targetBlob) {
730
734
}
731
735
732
736
/**
733
- * Creates a copy request.
737
+ * Creates a copy request. Target blob information is copied from source.
734
738
*
735
739
* @param sourceBlobId a {@code BlobId} object for the source blob
736
740
* @param targetBlobId a {@code BlobId} object for the target blob
@@ -748,9 +752,7 @@ public static Builder builder() {
748
752
}
749
753
750
754
private static void checkContentType (BlobInfo blobInfo ) throws IllegalArgumentException {
751
- if (blobInfo .contentType () == null ) {
752
- throw new IllegalArgumentException ("Blob content type can not be null" );
753
- }
755
+ checkArgument (blobInfo .contentType () != null , "Blob content type can not be null" );
754
756
}
755
757
}
756
758
0 commit comments