In this simple topic, you’ll learn how to Remove Password Protection From Excel File using Java REST API. We will develop an application to decrypt Excel file using Java Cloud API by following the detailed and lucid steps mentioned in the following section. The created application can be used with any application supporting Java in macOS, Linux, or Windows environments and conversion can be done for free.
Prerequisite
- Download Aspose.Cells Cloud SDK for Java to decrypt Excel file using Java Cloud API
- Setup Java project with the above SDK to protect an XLS file
Steps to Reset Excel file Password using Java low code API
- Set the Client ID and Client Secret for the API to decrypt the Workbook with a password using Java REST API
- Create an object of the CellsApi class with client credentials to reset Excel file password using Java low code API
- Add the source XLS file names and load the source XLS using a name and File object in a HashMap
- Create an instance of the DeleteUnProtectWorkbookRequest to add the existing password and other properties
- Call the deleteUnProtectWorkbook request method to decrypt excel file with password using Java REST API
- Save the decrypted Excel file/s on the local disk
The aforementioned steps remove password protection on Excel using Java REST API. We will initiate the process with the setting up the SDK and creating the CellsAPI class instance. We will then load the source XLS file/s using a HashMap and create an instance of the DeleteUnProtectWorkbookRequest class that is further used for resetting the password protection for the Excel files using the deleteUnProtectWorkbook() method.
Code to Decrypt Excel file Password using Java REST API
This simple example code enables you to clear excel file password using Java low code API. You need to provide the source Excel files and existing password for removing protection along with other optional properties. After formulating the Request Message, deleteUnProtectWorkbook() performs the decryption on the Excel file and returns the password cleared Excel files that can stored on the disk or inside the database.
We have learned to decrypt Workbook with Password using Java REST API in this topic. If you want to set the password for an Excel file, refer to the article on how to Password Protect Excel File with Java REST API.