@@ -85,9 +85,6 @@ public StorageObject apply(BlobInfo blobInfo) {
85
85
private final boolean isDirectory ;
86
86
private final CustomerEncryption customerEncryption ;
87
87
private final String kmsKeyName ;
88
- private final Boolean eventBasedHold ;
89
- private final Boolean temporaryHold ;
90
- private final Long retentionExpirationTime ;
91
88
92
89
/**
93
90
* This class is meant for internal use only. Users are discouraged from using this class.
@@ -271,19 +268,12 @@ public abstract static class Builder {
271
268
272
269
abstract Builder setCustomerEncryption (CustomerEncryption customerEncryption );
273
270
274
- abstract Builder setKmsKeyName (String kmsKeyName );
275
-
276
- /**
277
- * Sets the blob's event based hold.
278
- */
279
- public abstract Builder setEventBasedHold (Boolean eventBasedHold );
280
-
281
271
/**
282
- * Sets the blob's temporary hold.
272
+ *
273
+ * Sets the blob's kmsKeyName.
283
274
*/
284
- public abstract Builder setTemporaryHold (Boolean temporaryHold );
285
-
286
- abstract Builder setRetentionExpirationTime (Long retentionExpirationTime );
275
+ @ GcpLaunchStage .Beta
276
+ abstract Builder setKmsKeyName (String kmsKeyName );
287
277
288
278
/**
289
279
* Creates a {@code BlobInfo} object.
@@ -318,9 +308,6 @@ static final class BuilderImpl extends Builder {
318
308
private CustomerEncryption customerEncryption ;
319
309
private StorageClass storageClass ;
320
310
private String kmsKeyName ;
321
- private Boolean eventBasedHold ;
322
- private Boolean temporaryHold ;
323
- private Long retentionExpirationTime ;
324
311
325
312
BuilderImpl (BlobId blobId ) {
326
313
this .blobId = blobId ;
@@ -352,9 +339,6 @@ static final class BuilderImpl extends Builder {
352
339
isDirectory = blobInfo .isDirectory ;
353
340
storageClass = blobInfo .storageClass ;
354
341
kmsKeyName = blobInfo .kmsKeyName ;
355
- eventBasedHold = blobInfo .eventBasedHold ;
356
- temporaryHold = blobInfo .temporaryHold ;
357
- retentionExpirationTime = blobInfo .retentionExpirationTime ;
358
342
}
359
343
360
344
@ Override
@@ -502,30 +486,13 @@ Builder setCustomerEncryption(CustomerEncryption customerEncryption) {
502
486
return this ;
503
487
}
504
488
489
+ @ GcpLaunchStage .Beta
505
490
@ Override
506
491
Builder setKmsKeyName (String kmsKeyName ) {
507
492
this .kmsKeyName = kmsKeyName ;
508
493
return this ;
509
494
}
510
495
511
- @ Override
512
- public Builder setEventBasedHold (Boolean eventBasedHold ) {
513
- this .eventBasedHold = eventBasedHold ;
514
- return this ;
515
- }
516
-
517
- @ Override
518
- public Builder setTemporaryHold (Boolean temporaryHold ) {
519
- this .temporaryHold = temporaryHold ;
520
- return this ;
521
- }
522
-
523
- @ Override
524
- Builder setRetentionExpirationTime (Long retentionExpirationTime ) {
525
- this .retentionExpirationTime = retentionExpirationTime ;
526
- return this ;
527
- }
528
-
529
496
@ Override
530
497
public BlobInfo build () {
531
498
checkNotNull (blobId );
@@ -559,9 +526,6 @@ public BlobInfo build() {
559
526
isDirectory = firstNonNull (builder .isDirectory , Boolean .FALSE );
560
527
storageClass = builder .storageClass ;
561
528
kmsKeyName = builder .kmsKeyName ;
562
- eventBasedHold = builder .eventBasedHold ;
563
- temporaryHold = builder .temporaryHold ;
564
- retentionExpirationTime = builder .retentionExpirationTime ;
565
529
}
566
530
567
531
/**
@@ -795,31 +759,11 @@ public StorageClass getStorageClass() {
795
759
/**
796
760
* Returns the Cloud KMS key used to encrypt the blob, if any.
797
761
*/
762
+ @ GcpLaunchStage .Beta
798
763
public String getKmsKeyName () {
799
764
return kmsKeyName ;
800
765
}
801
766
802
- /**
803
- * Returns the event based hold status of the blob, if any.
804
- */
805
- public Boolean getEventBasedHold () {
806
- return eventBasedHold ;
807
- }
808
-
809
- /**
810
- * Returns the temporary hold status of the blob, if any.
811
- */
812
- public Boolean getTemporaryHold () {
813
- return temporaryHold ;
814
- }
815
-
816
- /**
817
- * Returns the retention expiration time of the blob, if a retention period is defined.
818
- */
819
- public Long getRetentionExpirationTime () {
820
- return retentionExpirationTime ;
821
- }
822
-
823
767
/**
824
768
* Returns a builder for the current blob.
825
769
*/
@@ -892,13 +836,8 @@ public ObjectAccessControl apply(Acl acl) {
892
836
if (customerEncryption != null ) {
893
837
storageObject .setCustomerEncryption (customerEncryption .toPb ());
894
838
}
895
- if (retentionExpirationTime != null ) {
896
- storageObject .setRetentionExpirationTime (new DateTime (retentionExpirationTime ));
897
- }
898
839
899
840
storageObject .setKmsKeyName (kmsKeyName );
900
- storageObject .setEventBasedHold (eventBasedHold );
901
- storageObject .setTemporaryHold (temporaryHold );
902
841
storageObject .setMetadata (pbMetadata );
903
842
storageObject .setCacheControl (cacheControl );
904
843
storageObject .setContentEncoding (contentEncoding );
@@ -1032,15 +971,6 @@ public Acl apply(ObjectAccessControl objectAccessControl) {
1032
971
if (storageObject .getKmsKeyName () != null ) {
1033
972
builder .setKmsKeyName (storageObject .getKmsKeyName ());
1034
973
}
1035
- if (storageObject .getEventBasedHold () != null ) {
1036
- builder .setEventBasedHold (storageObject .getEventBasedHold ());
1037
- }
1038
- if (storageObject .getTemporaryHold () != null ) {
1039
- builder .setTemporaryHold (storageObject .getTemporaryHold ());
1040
- }
1041
- if (storageObject .getRetentionExpirationTime () != null ) {
1042
- builder .setRetentionExpirationTime (storageObject .getRetentionExpirationTime ().getValue ());
1043
- }
1044
974
return builder .build ();
1045
975
}
1046
976
}
0 commit comments