In this simple topic, you’ll learn how to Remove Password Protection From XLSX File using Java REST API. We will develop an application to decrypt XLSX 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
- Create an account and get API credentials
- Download Aspose.Cells Cloud SDK for Java to decrypt XLSX file using Java Cloud API
- Setup Java project with the above SDK to protect an XLSX file
Steps to Reset XLSX 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 XLSX file password using Java low code API
- Add the source XLSX file names and load the source XLSX 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 XLSX file/s on the local disk
The aforementioned steps remove password protection on XLSX 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 XLSX file/s using a HashMap and create an instance of the DeleteUnProtectWorkbookRequest class that is further used for resetting the password protection for the XLSX files using the deleteUnProtectWorkbook() method.
Code to Decrypt XLSX 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 XLSX files and existing password for removing protection along with other optional properties. After formulating the Request Message, deleteUnProtectWorkbook() performs the decryption on the XLSX file and returns the password cleared XLSX 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 XLSX file, refer to the article on how to Password Protect XLSX File with Java REST API.