Help Center/ Object Storage Service/ Android SDK Developer Guide (Ally Region)/ Quick Start/ Listing Objects
Updated on 2026-01-16 GMT+08:00
Listing Objects
After objects are uploaded, you may want to view the objects contained in a bucket. Sample code is as follows:
ObjectListing objectListing = obsClient.listObjects("bucketname"); for(ObsObject obsObject : objectListing.getObjects()){ Log.i("ListObjects", " - " + obsObject.getObjectKey() + " " + "(size = " + obsObject.getMetadata().getContentLength() + ")"); }
- When you call ObsClient.listObjects, an instance of ObjectListing will be returned. This instance contains the response of the listObject request. You can use ObjetListing.getObjects to obtain description of all of the listed objects.
- In the previous sample code, 1000 objects will be listed, by default.
- For more information, see Listing Objects.
Parent topic: Quick Start
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot