import com.volcengine.tos.TOSV2;
import com.volcengine.tos.TOSV2ClientBuilder;
import com.volcengine.tos.TosClientException;
import com.volcengine.tos.TosServerException;
import com.volcengine.tos.model.bucket.GetBucketObjectSetConfigurationInput;
import com.volcengine.tos.model.bucket.GetBucketObjectSetConfigurationOutput;
public class GetBucketObjectSetConfigurationExample {
public static void main(String[] args) {
String endpoint = System.getenv("TOS_ENDPOINT");
String region = System.getenv("TOS_REGION");
String accessKey = System.getenv("TOS_ACCESS_KEY");
String secretKey = System.getenv("TOS_SECRET_KEY");
String bucket = System.getenv("TOS_BUCKET");
TOSV2 tos = new TOSV2ClientBuilder().build(region, endpoint, accessKey, secretKey);
GetBucketObjectSetConfigurationInput input = GetBucketObjectSetConfigurationInput.builder()
GetBucketObjectSetConfigurationOutput output = tos.getBucketObjectSetConfiguration(input);
System.out.println("getBucketObjectSetConfiguration succeed");
System.out.println("PathLevel: " + output.getPathLevel());
System.out.println("CustomDelimiter: " + output.getCustomDelimiter());
System.out.println("EnableDefaultObjectSet: " + output.getEnableDefaultObjectSet());
System.out.println("StorageQuota: " + output.getStorageQuota());
System.out.println("RequestID: " + output.getRequestInfo().getRequestId());
} catch (TosClientException e) {
System.out.println("getBucketObjectSetConfiguration failed");
System.out.println("Message: " + e.getMessage());
if (e.getCause() != null) {
e.getCause().printStackTrace();
} catch (TosServerException e) {
System.out.println("getBucketObjectSetConfiguration failed");
System.out.println("StatusCode: " + e.getStatusCode());
System.out.println("Code: " + e.getCode());
System.out.println("Message: " + e.getMessage());
System.out.println("RequestID: " + e.getRequestID());
System.out.println("getBucketObjectSetConfiguration failed");
System.out.println("unexpected exception, message: " + t.getMessage());