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

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

Function

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

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

Restrictions

Method

obsClient.getBucketPublicStatus(GetBucketPublicStatusRequest request )

Request Parameters

Table 1 List of request parameters

Parameter

Type

Mandatory (Yes/No)

Description

request

GetBucketPublicStatusRequest

Yes

Explanation:

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

Table 2 GetBucketPublicStatusRequest

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 GetBucketPublicStatusResult

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

bucketPublicStatus

BucketPublicStatus

Explanation:

Public access status of the bucket.

Default value:

None

Table 4 BucketPublicStatus

Parameter

Type

Description

isPublic

Boolean

Explanation:

Whether the bucket is public.

Default value:

None