Extract a Zipped Object

The following SDK method will allow you to extract a zip file inside Stratus, and every individual content present in the zip file will be considered as individual object and uploaded to Stratus in the same bucket. This entire process will happen asynchronously. The Bucket reference used in the below code snippet is the component instance.

Info: To use this SDK method, you need intialize it with Admin scope. You can learn more about this requirement from this section
Note: Since the extraction process occurs asynchronously, the time in which the entire process is completed is dependent on the size of the zip file that is being extracted.

Parameters Used

Parameter Name Data Type Definition
key String A Mandatory parameter. Will be the name of the zip file, you need to extract
destination String A Mandatory parameter. Will contain the complete path information of the destination, where the extracted objects will be stored in the bucket.

Ensure the following packages are imported

    
copy
import com.zc.component.stratus.beans.ZCStratusZipExtractResponse;
    
copy
ZCStratusZipExtractResponse res = bucket.unzipObject("sam/out/sample.zip","output/"); System.out.println(res.getObjectName()); System.out.println(res.getTaskId());

Get Zip Extraction Status

The zip extraction process occurs asynchronously, and the time it takes to complete the extraction process is highly contingent on the size of the zip file.

Info: To use this SDK method, you need intialize it with Admin scope. You can learn more about this requirement from this section

Using the taskId parameter, in the following SDK method, we can determine the status of the extraction. The taskId is returned in the response of unzipObject() method.

Ensure the following packages are imported

    
copy
import org.json.simple.JSONObject;
    
copy
JSONObject res = object.getUnzipStatus("sam/out/sample.zip","taskId"); System.out.println(res);

Example Response

    
copy
{ "task_id": "6963000000272049", "status": "SUCCESS" }

Last Updated 2025-05-30 16:54:59 +0530 +0530