Get Bucket CORS
The getCors() SDK method, will return the current CORS configuration of a specific bucket in Stratus. The Bucket reference used in the below code snippet is the component instance.
Info: To use this SDK method, you need intialize it with Admin scope. You can learn more about this requirement from this section
CORS of a bucket can be edited by any user that has or has been granted Write permission for Stratus component in the project, using the Profiles & Permissions section.
Note: You can find out more about Bucket CORS from this help section.
Ensure the following packages are imported
copyimport com.zc.component.stratus.beans.ZCStratusCorsResponse; import java.util.List;
copyList<ZCStratusCorsResponse> res = bucket.getCors(); for(ZCStratusCorsResponse cors: res){ System.out.println(cors.getDomain()); }
Last Updated 2025-06-20 16:21:48 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit