Thanks for stopping by to let us know something could be better!
Environment details
API: https://github.com/googleapis/java-storage
2. OS type and version: All OS
3. Java version: 8
4. version(s): 2.13.0
Steps to reproduce
- Create a Bucket in GCP Console
- For the Bucket just created Add a LifeCyle Rule with Condition: MatchPrefix and Match Suffix. Save the Configuration.
- Using Google Cloud API, create a Bucket Object for the bucket created from the step 1.
- sysout the LifeCyleCondition, correct behaviour is for the LifecycleRule. getCondition.getMatchesPrefix() & LifecycleRule. getCondition.getMatchesSuffix() return the values set using step 3.
- But the values are shown as null, even though the values are populated from the Console UI
Code example
for (BucketInfo.LifecycleRule rule : bucket.getLifecycleRules()) {
System.out.println(" Action: " + rule.getAction()); //Returns the Action
System.out.println("Match Prefix :: " + rule.getCondition().getMatchesPrefix()); //returns null
System.out.println("Age :: " + rule.getCondition().getAge()); //return value 5
}
Stack trace
Not applicable
External references such as API reference guides
Not applicable
Any additional information below
The reason for this behaviour:
While the API is able to bring the MatchPrefix and Matchsuffix, the same is not used in the Builder.
LifecycleRule fromPb(Rule rule) method, while building the LifeCyleRuleCondition, doesnt populate the matchPrefix and matchsuffix values.
Following these steps guarantees the quickest resolution possible.
Thanks!
Thanks for stopping by to let us know something could be better!
Environment details
API: https://github.com/googleapis/java-storage
2. OS type and version: All OS
3. Java version: 8
4. version(s): 2.13.0
Steps to reproduce
Code example
Stack trace
Not applicable
External references such as API reference guides
Not applicable
Any additional information below
The reason for this behaviour:
While the API is able to bring the MatchPrefix and Matchsuffix, the same is not used in the Builder.
LifecycleRule fromPb(Rule rule) method, while building the LifeCyleRuleCondition, doesnt populate the matchPrefix and matchsuffix values.
Following these steps guarantees the quickest resolution possible.
Thanks!