Java API to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet
Java Clear to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet
Clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet - Java REST API
API Request:
POST
https://api.aspose.cloud/v3.0/cells/clear
Clearing list objects on local Microsoft Excel and OpenOffice Calc spreadsheet is a complex task. Clearing list objects on local Microsoft Excel and OpenOffice Calc spreadsheet transitions is performed by our Java SDK while maintaining the source spreadsheet's main structural and logical content. Our Java library is a professional solution to clear list objects on local Microsoft Excel and OpenOffice Calc spreadsheet online. This Cloud SDK gives Java developers powerful functionality and perfect API.
Java code for clearing list objects on local spreadsheets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api; | |
import com.aspose.cloud.cells.client.*; | |
import com.aspose.cloud.cells.model.*; | |
import com.aspose.cloud.cells.request.*; | |
import java.io.IOException; | |
import org.junit.Test; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.io.File; | |
import java.util.HashMap; | |
public class Example { | |
private CellsApi api; | |
public Example(){ | |
try { | |
api = new CellsApi( | |
System.getenv("CellsCloudClientId"), | |
System.getenv("CellsCloudClientSecret"), | |
"v3.0", | |
System.getenv("CellsCloudApiBaseUrl") | |
); | |
} catch (ApiException e) { | |
e.printStackTrace(); | |
} | |
} | |
public void Run(){ | |
try{ | |
String remoteFolder = "TestData/In"; | |
String localName = "Book1.xlsx"; | |
String remoteName = "Book1.xlsx"; | |
UploadFileRequest uploadFileRequest = new UploadFileRequest(); | |
uploadFileRequest.setPath( remoteFolder + "/" + remoteName ); | |
uploadFileRequest.setStorageName( ""); | |
HashMap<String,File> files = new HashMap<String,File>(); | |
files.put( localName , new File(localName )); | |
uploadFileRequest.setUploadFiles(files); | |
api.uploadFile(uploadFileRequest); | |
PostClearObjectsRequest request = new PostClearObjectsRequest(); | |
request.setFile(remoteName); | |
request.setObjecttype("ListObject"); | |
request.setSheetname(""); | |
request.setOutFormat(""); | |
request.setPassword(""); | |
request.setCheckExcelRestriction(false); | |
FilesResult response = api.postClearObjects(request); | |
} catch (ApiException e) { | |
e.printStackTrace(); | |
}catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
How to use Java API to clear list objects
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call postClearObjects method to get the resultant stream
System Requirements
- Android 7 or newer
- Java(TM) SE Runtime Environment