You can call the HeadObject method to obtain only the metadata but not the content of an object.

Run the following code to obtain the metadata of an object:

// Create a request to obtain the metadata of an object by calling the synchronous interface.
HeadObjectRequest head = new HeadObjectRequest("<bucketName>", "<objectKey>");

// Obtain the metadata of an object.
OSSAsyncTask task = oss.asyncHeadObject(head, new OSSCompletedCallback<HeadObjectRequest, HeadObjectResult>() {
    @Override
    public void onSuccess(HeadObjectRequest request, HeadObjectResult result) {
	
	// Obtain the size of the object.
        Log.d("headObject", "object Size: " + result.getMetadata().getContentLength()); 
	// Obtain the type of the object.
        Log.d("headObject", "object Content Type: " + result.getMetadata().getContentType()); 
    }

    @Override
    public void onFailure(HeadObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
        // Handle the exceptions returned for the request.
        if (clientExcepion != null) {
            // A local exception (such as network exception) occurs.
            clientExcepion.printStackTrace();
        }
        if (serviceException != null) {
            // A service exception occurs.
            Log.e("ErrorCode", serviceException.getErrorCode());
            Log.e("RequestId", serviceException.getRequestId());
            Log.e("HostId", serviceException.getHostId());
            Log.e("RawMessage", serviceException.getRawMessage());
        }
    }
});

// task.waitUntilFinished(); // Wait until the task is complete.