Skip to content

Commit 9ef1a35

Browse files
committed
Add repair api.
1 parent 83b3917 commit 9ef1a35

File tree

4 files changed

+186
-9
lines changed

4 files changed

+186
-9
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-java/23.6)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-java)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-java/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-java/23.7)
22

33
# Java SDK for Spreadsheet Processing in the Cloud
44

@@ -24,16 +24,11 @@ This Cloud SDK enhances your Java-based cloud apps to [process & manipulate Micr
2424
- Fetch the required shape from worksheet.
2525
- Leverage the power of [Pivot Tables](https://docs.aspose.cloud/cells/working-with-pivot-tables/) & Ranges.
2626

27-
## Feature & Enhancements in Version 23.6
27+
## Feature & Enhancements in Version 23.7
2828

2929
Full list of issues covering all changes in this release:
3030

31-
- Support to batch lock multi-files.
32-
- Support to batch unlock multi-files.
33-
- Support to protect lock multi-files.
34-
- Support to split lock multi-files.
35-
- Fix put document property api.
36-
31+
- Support to repair file.
3732

3833

3934
## Read & Write Spreadsheet Formats

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aspose-cells-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>aspose-cells-cloud</name>
8-
<version>23.6</version>
8+
<version>23.7</version>
99
<url>https://github.com/aspose-cells-cloud/aspose-cells-cloud-java</url>
1010
<scm>
1111
<connection>scm:git:git@github.com:aspose-cells-cloud/aspose-cells-cloud-java</connection>

src/main/java/com/aspose/cloud/cells/api/CellsApi.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55747,6 +55747,60 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
5574755747
}
5574855748

5574955749

55750+
@SuppressWarnings("rawtypes")
55751+
private com.squareup.okhttp.Call postRepairValidateBeforeCall(PostRepairRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
55752+
return request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true);
55753+
}
55754+
55755+
public FilesResult postRepair(PostRepairRequest request) throws ApiException, IOException {
55756+
try {
55757+
ApiResponse< FilesResult > resp = postRepairWithHttpInfo(request);
55758+
return resp.getData();
55759+
}
55760+
catch (ApiException ex) {
55761+
if (ex.getCode() == apiClient.getNotAuthCode()) {
55762+
apiClient.requestToken();
55763+
ApiResponse< FilesResult > resp = postRepairWithHttpInfo(request);
55764+
return resp.getData();
55765+
}
55766+
throw ex;
55767+
}
55768+
}
55769+
55770+
private ApiResponse< FilesResult > postRepairWithHttpInfo(PostRepairRequest request) throws ApiException, IOException {
55771+
com.squareup.okhttp.Call call = postRepairValidateBeforeCall(request, null, null);
55772+
Type localVarReturnType = new TypeToken< FilesResult >(){}.getType();
55773+
return apiClient.execute(call, localVarReturnType);
55774+
}
55775+
55776+
public com.squareup.okhttp.Call postRepairAsync( PostRepairRequest request, final ApiCallback< FilesResult > callback) throws ApiException, IOException {
55777+
55778+
ProgressResponseBody.ProgressListener progressListener = null;
55779+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
55780+
55781+
if (callback != null) {
55782+
progressListener = new ProgressResponseBody.ProgressListener() {
55783+
@Override
55784+
public void update(long bytesRead, long contentLength, boolean done) {
55785+
callback.onDownloadProgress(bytesRead, contentLength, done);
55786+
}
55787+
};
55788+
55789+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
55790+
@Override
55791+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
55792+
callback.onUploadProgress(bytesWritten, contentLength, done);
55793+
}
55794+
};
55795+
}
55796+
55797+
com.squareup.okhttp.Call call = postRepairValidateBeforeCall(request, progressListener, progressRequestListener);
55798+
Type localVarReturnType = new TypeToken< FilesResult >(){}.getType();
55799+
apiClient.executeAsync(call, localVarReturnType, callback);
55800+
return call;
55801+
}
55802+
55803+
5575055804
@SuppressWarnings("rawtypes")
5575155805
private com.squareup.okhttp.Call postRotateValidateBeforeCall(PostRotateRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
5575255806
return request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true);
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="PostRepairRequest.java">
4+
* Copyright (c) 2023 Aspose.Cells Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
package com.aspose.cloud.cells.request;
28+
import com.aspose.cloud.cells.client.*;
29+
import com.aspose.cloud.cells.model.*;
30+
import com.squareup.okhttp.*;
31+
import java.io.*;
32+
import java.lang.reflect.Type;
33+
import java.util.*;
34+
35+
public class PostRepairRequest implements IRequestModel {
36+
private HashMap<String,String> extendQueryParameterMap;
37+
public HashMap<String,String> getExtendQueryParameterMap() {
38+
return this.extendQueryParameterMap;
39+
}
40+
41+
public void setExtendQueryParameterMap( HashMap<String,String> extendQueryParameterMap) {
42+
this.extendQueryParameterMap = extendQueryParameterMap;
43+
}
44+
private HashMap<String,File> file;
45+
private String format;
46+
public PostRepairRequest()
47+
{
48+
49+
}
50+
public PostRepairRequest(HashMap<String,File> file, String format) {
51+
this.file = file;
52+
this.format = format;
53+
}
54+
55+
public HashMap<String,File> getFile() {
56+
return file;
57+
}
58+
59+
public void setFile(HashMap<String,File> file) {
60+
this.file = file;
61+
}
62+
63+
64+
public String getFormat() {
65+
return format;
66+
}
67+
68+
public void setFormat(String format) {
69+
this.format = format;
70+
}
71+
72+
@Override
73+
public Call buildHttpRequest(ApiClient apiClient, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener, Boolean addAuthHeaders) throws ApiException {
74+
if (getFile() == null) {
75+
throw new ApiException("Missing the required parameter 'File' when calling PostRepair");
76+
}
77+
String localVarPath = "/cells/repair";
78+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
79+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
80+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
81+
if (getFormat() != null){
82+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "format", getFormat()));
83+
}
84+
if(this.extendQueryParameterMap !=null){
85+
for (String key :this.extendQueryParameterMap.keySet()) {
86+
localVarQueryParams.addAll(apiClient.parameterToPairs("", key, this.extendQueryParameterMap.get(key)));
87+
}
88+
}
89+
90+
if (getFile() != null){
91+
for (String key : getFile().keySet()) {
92+
localVarFormParams.put(key,getFile().get(key));
93+
}
94+
}
95+
Object localVarPostBody = null;
96+
final String[] localVarAccepts = {
97+
"application/json"
98+
};
99+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
100+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
101+
102+
final String[] localVarContentTypes = { "application/json" };
103+
if(getFile() != null){
104+
localVarContentTypes[0] = "multipart/form-data";
105+
}
106+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
107+
localVarHeaderParams.put("Content-Type", localVarContentType);
108+
109+
if(progressListener != null) {
110+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
111+
@Override
112+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
113+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
114+
return originalResponse.newBuilder()
115+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
116+
.build();
117+
}
118+
});
119+
}
120+
121+
String[] localVarAuthNames = new String[] { };
122+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
123+
124+
}
125+
126+
127+
}
128+

0 commit comments

Comments
 (0)