diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java index 602be08ac..5b69814ec 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/BucketInfo.java @@ -48,6 +48,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.logging.Logger; /** * Google Storage bucket metadata; @@ -101,6 +102,8 @@ public com.google.api.services.storage.model.Bucket apply(BucketInfo bucketInfo) private final String locationType; private final Logging logging; + private static final Logger log = Logger.getLogger(BucketInfo.class.getName()); + /** * The Bucket's IAM Configuration. * @@ -356,9 +359,11 @@ public LifecycleRule(LifecycleAction action, LifecycleCondition condition) { && condition.getNoncurrentTimeBefore() == null && condition.getCustomTimeBefore() == null && condition.getDaysSinceCustomTime() == null) { - throw new IllegalArgumentException( - "You must specify at least one condition to use object lifecycle " - + "management. Please see https://cloud.google.com/storage/docs/lifecycle for details."); + log.warning( + "Creating a lifecycle condition with no supported conditions:\n" + + this + + "\nAttempting to update with this rule may cause errors. Please update " + + " to the latest version of google-cloud-storage"); } this.lifecycleAction = action;