Skip to content

Commit 871f430

Browse files
committed
Release Aspose.Cells Cloud SDK 20.7
1 parent 2a79a8e commit 871f430

25 files changed

+62853
-42651
lines changed

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>20.6</version>
8+
<version>20.7</version>
99
<url>https://github.com/aspose-cells-cloud/aspose-cells-cloud-java</url>
1010
<scm>
1111
<connection>scm:git:[email protected]:aspose-cells-cloud/aspose-cells-cloud-java</connection>

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

Lines changed: 60335 additions & 40319 deletions
Large diffs are not rendered by default.

src/main/java/com/aspose/cloud/cells/client/ApiClient.java

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public class ApiClient {
127127
*/
128128
public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
129129

130-
private String basePath = "https://api.aspose.cloud/v3.0";
130+
private String basePath = "https://api.aspose.cloud";
131131
private boolean lenientOnJson = false;
132132
private boolean debugging = false;
133133
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
@@ -174,7 +174,7 @@ public ApiClient() {
174174
this.lenientDatetimeFormat = true;
175175

176176
// Set default User-Agent.
177-
setUserAgent("Swagger-Codegen/20.2/java");
177+
setUserAgent("Swagger-Codegen/20.7/java");
178178

179179
// Setup authentications (key: authentication name, value:
180180
// authentication).
@@ -188,7 +188,7 @@ public ApiClient() {
188188

189189
private String appSid;
190190
private String appKey;
191-
private String appVersion;
191+
private String appVersion = "v3.0";
192192
private String appGrantType;
193193
private DateTime getAccessTokenTime;
194194

@@ -239,8 +239,8 @@ public String getAccessToken(String grantType, String clientId,
239239

240240
String[] localVarAuthNames = new String[] {};
241241

242-
Request request = buildRequest(localVarPath, "POST", localVarQueryParams, localVarPostBody,
243-
localVarHeaderParams, localVarFormParams, localVarAuthNames, null);
242+
Request request = buildGetAccessTokenRequest(localVarPath, localVarQueryParams, localVarPostBody,
243+
localVarHeaderParams, localVarFormParams, localVarAuthNames);
244244

245245
com.squareup.okhttp.Call call = httpClient.newCall(request);
246246

@@ -258,11 +258,9 @@ public void checkAccessToken() throws ApiException {
258258
return;
259259
}
260260
if (DateTime.now().compareTo(getAccessTokenTime.plusSeconds(86300))>0 ) {
261-
setBasePath("https://api.aspose.cloud");
262261
String accessToken = getAccessToken(appGrantType, appSid, appKey,
263262
appVersion);
264263
getAccessTokenTime = DateTime.now();
265-
setBasePath("https://api.aspose.cloud/" + appVersion);
266264
addDefaultHeader("Authorization", "Bearer " + accessToken);
267265
}
268266
}
@@ -287,6 +285,10 @@ public ApiClient setBasePath(String basePath) {
287285
this.basePath = basePath;
288286
return this;
289287
}
288+
public ApiClient setApiVersion(String apiVersion) {
289+
this.appVersion = apiVersion;
290+
return this;
291+
}
290292

291293
/**
292294
* Get HTTP client
@@ -1366,7 +1368,68 @@ public Request buildRequest(String path, String method,
13661368

13671369
return request;
13681370
}
1371+
private Request buildGetAccessTokenRequest(String path, List<Pair> queryParams, Object body,
1372+
Map<String, String> headerParams, Map<String, Object> formParams,
1373+
String[] authNames)
1374+
throws ApiException {
1375+
updateParamsForAuth(authNames, queryParams, headerParams);
1376+
1377+
final StringBuilder urlBuilder = new StringBuilder();
1378+
urlBuilder.append(basePath).append(path);
13691379

1380+
if (queryParams != null && !queryParams.isEmpty()) {
1381+
// support (constant) query string in `path`, e.g. "/posts?draft=1"
1382+
String prefix = path.contains("?") ? "&" : "?";
1383+
for (Pair param : queryParams) {
1384+
if (param.getValue() != null) {
1385+
if (prefix != null) {
1386+
urlBuilder.append(prefix);
1387+
prefix = null;
1388+
} else {
1389+
urlBuilder.append("&");
1390+
}
1391+
String value = parameterToString(param.getValue());
1392+
urlBuilder.append(escapeString(param.getName())).append("=")
1393+
.append(escapeString(value));
1394+
}
1395+
}
1396+
}
1397+
final String url = urlBuilder.toString();
1398+
1399+
final Request.Builder reqBuilder = new Request.Builder().url(url);
1400+
processHeaderParams(headerParams, reqBuilder);
1401+
1402+
String contentType = (String) headerParams.get("Content-Type");
1403+
// ensuring a default content type
1404+
if (contentType == null) {
1405+
contentType = "application/json";
1406+
}
1407+
String method ="POST";
1408+
RequestBody reqBody;
1409+
if (!HttpMethod.permitsRequestBody(method)) {
1410+
reqBody = null;
1411+
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
1412+
reqBody = buildRequestBodyFormEncoding(formParams);
1413+
} else if ("multipart/form-data".equals(contentType)) {
1414+
reqBody = buildRequestBodyMultipart(formParams);
1415+
} else if (body == null) {
1416+
if ("DELETE".equals(method)) {
1417+
// allow calling DELETE without sending a request body
1418+
reqBody = null;
1419+
} else {
1420+
// use an empty request body (for POST, PUT and PATCH)
1421+
reqBody = RequestBody.create(MediaType.parse(contentType), "");
1422+
}
1423+
} else {
1424+
reqBody = serialize(body, contentType);
1425+
}
1426+
1427+
Request request = null;
1428+
1429+
request = reqBuilder.method(method, reqBody).build();
1430+
1431+
return request;
1432+
}
13701433
/**
13711434
* Build full URL by concatenating base path, the given sub path and query
13721435
* parameters.
@@ -1379,7 +1442,7 @@ public Request buildRequest(String path, String method,
13791442
*/
13801443
public String buildUrl(String path, List<Pair> queryParams) {
13811444
final StringBuilder url = new StringBuilder();
1382-
url.append(basePath).append(path);
1445+
url.append(basePath + "/" + appVersion ).append(path);
13831446

13841447
if (queryParams != null && !queryParams.isEmpty()) {
13851448
// support (constant) query string in `path`, e.g. "/posts?draft=1"

src/test/java/com/aspose/cloud/cells/api/CellsApiForV11Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class CellsApiForV11Test {
6565
private String BOOK1 = "Book1.xlsx";
6666
private String MYDOC = "myDocument.xlsx";
6767
private String PivTestFile = "TestCase.xlsx";
68-
private String TEMPFOLDER = "Temp";//"CellsTests";
68+
private String TEMPFOLDER = "JavaTest";//"CellsTests";
6969
private String SHEET1 = "Sheet1";
7070
private String SHEET2 = "Sheet2";
7171
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsAutoFilterApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class CellsAutoFilterApiTest {
4444
private String BOOK1 = "Book1.xlsx";
4545
private String MYDOC = "myDocument.xlsx";
4646
private String PivTestFile = "TestCase.xlsx";
47-
private String TEMPFOLDER = "Temp";
47+
private String TEMPFOLDER = "JavaTest";
4848
private String SHEET1 = "Sheet1";
4949
private String SHEET2 = "Sheet2";
5050
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsAutoshapesApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class CellsAutoshapesApiTest {
4141
private String BOOK1 = "Book1.xlsx";
4242
private String MYDOC = "myDocument.xlsx";
4343
private String PivTestFile = "TestCase.xlsx";
44-
private String TEMPFOLDER = "Temp";
44+
private String TEMPFOLDER = "JavaTest";
4545
private String SHEET1 = "Sheet1";
4646
private String SHEET2 = "Sheet2";
4747
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsChartAreaApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class CellsChartAreaApiTest {
4141
private String BOOK1 = "Book1.xlsx";
4242
private String MYDOC = "myDocument.xlsx";
4343
private String PivTestFile = "TestCase.xlsx";
44-
private String TEMPFOLDER = "Temp";
44+
private String TEMPFOLDER = "JavaTest";
4545
private String SHEET1 = "Sheet1";
4646
private String SHEET2 = "Sheet2";
4747
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsChartsApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class CellsChartsApiTest {
4848
private String BOOK1 = "Book1.xlsx";
4949
private String MYDOC = "myDocument.xlsx";
5050
private String PivTestFile = "TestCase.xlsx";
51-
private String TEMPFOLDER = "Temp";
51+
private String TEMPFOLDER = "JavaTest";
5252
private String SHEET1 = "Sheet1";
5353
private String SHEET2 = "Sheet2";
5454
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsConditionalFormattingsApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class CellsConditionalFormattingsApiTest {
4242
private String BOOK1 = "Book1.xlsx";
4343
private String MYDOC = "myDocument.xlsx";
4444
private String PivTestFile = "TestCase.xlsx";
45-
private String TEMPFOLDER = "Temp";
45+
private String TEMPFOLDER = "JavaTest";
4646
private String SHEET1 = "Sheet1";
4747
private String SHEET2 = "Sheet2";
4848
private String SHEET3 = "Sheet3";

src/test/java/com/aspose/cloud/cells/api/CellsHypelinksApiTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class CellsHypelinksApiTest {
4444
private String BOOK1 = "Book1.xlsx";
4545
private String MYDOC = "myDocument.xlsx";
4646
private String PivTestFile = "TestCase.xlsx";
47-
private String TEMPFOLDER = "Temp";
47+
private String TEMPFOLDER = "JavaTest";
4848
private String SHEET1 = "Sheet1";
4949
private String SHEET2 = "Sheet2";
5050
private String SHEET3 = "Sheet3";

0 commit comments

Comments
 (0)