-
Notifications
You must be signed in to change notification settings - Fork 85
Closed
Labels
api: storageIssues related to the googleapis/java-storage API.Issues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
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!
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/java-storage API.Issues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.