You must restore an Archive object before you read the object. This topic describes how to restore an Archive object.

Sample code

The following code provides an example on how to restore an Archive object:

// Restore the Archive object. 
RestoreObjectRequest restore = new RestoreObjectRequest();
// Specify the name of the bucket. Example: examplebucket. 
// Specify the full path of the object. The full path cannot contain the bucket name. Example: exampledir/exampleobject.txt. 
OSSAsyncTask task = oss.asyncRestoreObject(restore, new OSSCompletedCallback<RestoreObjectRequest,
        RestoreObjectResult>() {
    public void onSuccess(RestoreObjectRequest request, RestoreObjectResult result) {


    public void onFailure(RestoreObjectRequest request, ClientException clientException,
                          ServiceException serviceException) {
        OSSLog.logError("error: "+serviceException.getRawMessage());




  • For the complete sample code that is used to restore Archive objects, visit GitHub.
  • For more information about the API operation that you can call to restore Archive objects, see RestoreObject.