Help Center/ Object Storage Service/ SDK Reference/ Java/ Bucket Management (SDK for Java)/ Obtaining the Public Access Status of a Bucket Policy (SDK for Java)
Updated on 2025-07-29 GMT+08:00

Obtaining the Public Access Status of a Bucket Policy (SDK for Java)

Function

This API obtains the public access status of an OBS bucket policy.

If you have any questions during development, post them on the Issues page of GitHub.

Restrictions

Method

obsClient.getBucketPolicyPublicStatus(GetBucketPolicyPublicStatusRequest request)

Request Parameters

Table 1 List of request parameters

Parameter

Type

Mandatory (Yes/No)

Description

request

GetBucketPolicyPublicStatusRequest

Yes

Explanation:

Request parameters for obtaining the public access status of an OBS bucket policy. For details, see GetBucketPolicyPublicStatusRequest.

Table 2 GetBucketPolicyPublicStatusRequest

Parameter

Type

Mandatory (Yes/No)

Description

bucketName

String

Yes

Explanation:

Bucket name.

Restrictions:

  • A bucket name must be unique across all accounts and regions.
  • A bucket name:
    • Must be 3 to 63 characters long and start with a digit or letter. Lowercase letters, digits, hyphens (-), and periods (.) are allowed.
    • Cannot be formatted as an IP address.
    • Cannot start or end with a hyphen (-) or period (.).
    • Cannot contain two consecutive periods (..), for example, my..bucket.
    • Cannot contain periods (.) and hyphens (-) adjacent to each other, for example, my-.bucket or my.-bucket.
  • If you repeatedly create buckets with the same name in the same region, no error will be reported and the bucket attributes comply with those set in the first creation request.

Default value:

None

Responses

Table 3 GetBucketPolicyPublicStatusResult

Parameter

Type

Description

statusCode

int

Explanation:

HTTP status code.

Value range:

A status code is a group of digits indicating the status of a response. It ranges from 2xx (indicating successes) to 4xx or 5xx (indicating errors).

For more information, see Status Code.

Default value:

None

responseHeaders

Map<String, Object>

Explanation:

HTTP response header list, composed of tuples. In a tuple, the String key indicates the name of the header, and the Object value indicates the value of the header.

Default value:

None

bucketPolicyStatus

BucketPolicyStatus

Explanation:

Public access status of the bucket policy.

Default value:

None

Table 4 BucketPolicyStatus

Parameter

Type

Description

isPublic

Boolean

Explanation:

Whether the bucket policy is public.

Default value:

None