Applicable Scenario
The cloud platform's Cloud Object Storage (COS) supports listing object keys by a prefix. You can also use the / character to implement a hierarchical structure similar to the traditional file system. In COS, you can also use a separator to select and browse keys hierarchically.
You can list all keys in a single bucket in UTF-8 binary order of prefixes or filter the key list by specifying the prefix. For example, adding the parameter t will list the tapd object, but skip objects prefixed with a or other characters.
Add the / delimiter and objects keys will be reorganized based on this delimiter. You can combine prefixes and delimiters to achieve folder-like searching feature. For example, add the prefix parameter t and the delimiter /, object keys similar to tapd/file will be directly listed.
The cloud platform's COS supports storing an unlimited number of objects in a single bucket. Therefore, the object key list can be very large. For easy management, a maximum of 1,000 keys can be returned by a single list objects API, and a marker will be returned to inform you whether the list is truncated. You can send a series of listing object keys requests based on markers and separators to list all key values or find the content you need.
Usage Instructions
Using the REST API
Use REST APIs to initiate a request to get the object. For more information, see Get Bucket.
Using Java SDKs
COS supports AWS Java SDK. See Using AWS S3 SDK to Access COS to access COS, and operate according to the Get Bucket (List Objects) section in the official documentation of AWS Java SDK 2.20.0.