Skip to content

Commit e054043

Browse files
Merge branch 'master' into release
2 parents 0a2d382 + fe5bc5a commit e054043

File tree

12 files changed

+450
-17
lines changed

12 files changed

+450
-17
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ This repository contains Aspose.Words Cloud SDK for Java source code. This SDK a
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 21.7
17+
18+
- ImlRenderingMode option introduced witch is used to determine how ink (InkML) objects are rendered
19+
- MaxCharactersPerLine option introduced which is used to specify the maximum number of characters per one line
20+
- Added new API method to get a RSA public key to encrypt document passwords
21+
- Added encryptedPassword common query option to pass an encrypted document password
22+
23+
1624
## Enhancements in Version 21.6
1725

1826
- Implemented beta version of CompareDocumentOnline feature with both document sending in request
@@ -148,7 +156,7 @@ Add this dependency to your project's POM:
148156
<dependency>
149157
<groupId>com.aspose</groupId>
150158
<artifactId>aspose-words-cloud</artifactId>
151-
<version>21.6.0</version>
159+
<version>21.7.0</version>
152160
</dependency>
153161
</dependencies>
154162
```

examples/AcceptAllRevisions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
String fileName = "test_doc.docx";
1313

1414
// Upload original document to cloud storage.
15-
UploadFileRequest uploadFileRequest = new UploadFileRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),fileName,null);
16-
wordsApi.uploadFile(uploadFileRequest);
15+
UploadFileRequest uploadFileRequestRequest = new UploadFileRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),fileName,null);
16+
wordsApi.uploadFile(uploadFileRequestRequest);
1717

1818
// Calls AcceptAllRevisions method for document in cloud.
19-
AcceptAllRevisionsRequest request = new AcceptAllRevisionsRequest(fileName,null,null,null,null,null);
20-
wordsApi.acceptAllRevisions(request);
19+
AcceptAllRevisionsRequest requestRequest = new AcceptAllRevisionsRequest(fileName,null,null,null,null,null);
20+
wordsApi.acceptAllRevisions(requestRequest);

examples/AcceptAllRevisionsOnline.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
String fileName = "test_doc.docx";
55

66
// Calls AcceptAllRevisionsOnline method for document in cloud.
7-
AcceptAllRevisionsOnlineRequest request = new AcceptAllRevisionsOnlineRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),null,null,null);
8-
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(request);
7+
AcceptAllRevisionsOnlineRequest requestRequest = new AcceptAllRevisionsOnlineRequest(Files.readAllBytes(Paths.get(documentsDir, fileName).toAbsolutePath()),null,null,null);
8+
AcceptAllRevisionsOnlineResponse acceptAllRevisionsOnlineResult = wordsApi.acceptAllRevisionsOnline(requestRequest);
99
Files.write(Paths.get("test_result.docx"), acceptAllRevisionsOnlineResult.getDocument());

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>aspose-words-cloud</artifactId>
55
<packaging>jar</packaging>
66
<name>AsposeWordsCloud</name>
7-
<version>21.6.0</version>
7+
<version>21.7.0</version>
88
<url>https://www.aspose.cloud/</url>
99
<description>Aspose Words Java SDK</description>
1010
<scm>

src/main/java/com/aspose/words/cloud/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class ApiClient {
5656
private String apiVersion = "v4.0";
5757
private String baseUrl = "https://api.aspose.cloud";
5858
private String basePath = baseUrl + "/" + apiVersion;
59-
private String clientVersion = "21.6";
59+
private String clientVersion = "21.7";
6060
private boolean debugging = false;
6161
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
6262
private String tempFolderPath = null;

src/main/java/com/aspose/words/cloud/api/WordsApi.java

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11122,6 +11122,81 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
1112211122
return call;
1112311123
}
1112411124

11125+
@SuppressWarnings("rawtypes")
11126+
private com.squareup.okhttp.Call getPublicKeyValidateBeforeCall(GetPublicKeyRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
11127+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
11128+
}
11129+
11130+
/**
11131+
* Get assymetric public key.
11132+
* @param request Request object
11133+
* @return PublicKeyResponse
11134+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
11135+
* @throws IOException If fail to serialize the request body object
11136+
*/
11137+
public PublicKeyResponse getPublicKey(GetPublicKeyRequest request) throws ApiException, MessagingException, IOException {
11138+
try {
11139+
ApiResponse< PublicKeyResponse > resp = getPublicKeyWithHttpInfo(request);
11140+
return resp.getData();
11141+
}
11142+
catch (ApiException ex) {
11143+
if (ex.getCode() == apiClient.getNotAuthCode()) {
11144+
apiClient.requestToken();
11145+
ApiResponse< PublicKeyResponse > resp = getPublicKeyWithHttpInfo(request);
11146+
return resp.getData();
11147+
}
11148+
throw ex;
11149+
}
11150+
}
11151+
11152+
/**
11153+
* Get assymetric public key.
11154+
* @param request Request object
11155+
* @return ApiResponse< PublicKeyResponse >;
11156+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
11157+
* @throws IOException If fail to serialize the request body object
11158+
*/
11159+
private ApiResponse< PublicKeyResponse > getPublicKeyWithHttpInfo(GetPublicKeyRequest request) throws ApiException, MessagingException, IOException {
11160+
com.squareup.okhttp.Call call = getPublicKeyValidateBeforeCall(request, null, null);
11161+
Response response = call.execute();
11162+
PublicKeyResponse data = request.deserializeResponse(apiClient, response);
11163+
return new ApiResponse< PublicKeyResponse >(response.code(), response.headers().toMultimap(), data);
11164+
}
11165+
11166+
/**
11167+
* Get assymetric public key. (asynchronously)
11168+
* @param request Request object
11169+
* @param callback The callback to be executed when the API call finishes
11170+
* @return The request call
11171+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
11172+
* @throws IOException If fail to serialize the request body object
11173+
*/
11174+
public com.squareup.okhttp.Call getPublicKeyAsync(GetPublicKeyRequest request, final ApiCallback< PublicKeyResponse > callback) throws ApiException, MessagingException, IOException {
11175+
11176+
ProgressResponseBody.ProgressListener progressListener = null;
11177+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
11178+
11179+
if (callback != null) {
11180+
progressListener = new ProgressResponseBody.ProgressListener() {
11181+
@Override
11182+
public void update(long bytesRead, long contentLength, boolean done) {
11183+
callback.onDownloadProgress(bytesRead, contentLength, done);
11184+
}
11185+
};
11186+
11187+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
11188+
@Override
11189+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
11190+
callback.onUploadProgress(bytesWritten, contentLength, done);
11191+
}
11192+
};
11193+
}
11194+
11195+
com.squareup.okhttp.Call call = getPublicKeyValidateBeforeCall(request, progressListener, progressRequestListener);
11196+
apiClient.executeAsync(call, request.getResponseType(), callback);
11197+
return call;
11198+
}
11199+
1112511200
@SuppressWarnings("rawtypes")
1112611201
private com.squareup.okhttp.Call getRangeTextValidateBeforeCall(GetRangeTextRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
1112711202
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="PublicKeyResponse.java">
4+
* Copyright (c) 2021 Aspose.Words for 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+
28+
package com.aspose.words.cloud.model;
29+
30+
import java.util.Objects;
31+
import java.util.Arrays;
32+
import java.util.ArrayList;
33+
import java.util.List;
34+
import java.io.IOException;
35+
import org.threeten.bp.OffsetDateTime;
36+
import com.aspose.words.cloud.model.*;
37+
import com.google.gson.TypeAdapter;
38+
import com.google.gson.annotations.JsonAdapter;
39+
import com.google.gson.annotations.SerializedName;
40+
import com.google.gson.stream.JsonReader;
41+
import com.google.gson.stream.JsonWriter;
42+
import io.swagger.annotations.ApiModel;
43+
import io.swagger.annotations.ApiModelProperty;
44+
45+
/**
46+
* REST response for RSA public key info.
47+
*/
48+
@ApiModel(description = "REST response for RSA public key info.")
49+
public class PublicKeyResponse extends WordsResponse {
50+
@SerializedName("Exponent")
51+
private String exponent = null;
52+
53+
@SerializedName("Modulus")
54+
private String modulus = null;
55+
public PublicKeyResponse exponent(String exponent) {
56+
this.exponent = exponent;
57+
return this;
58+
}
59+
60+
/**
61+
* Gets or sets RSA key exponent as Base64 string.
62+
* @return exponent
63+
**/
64+
@ApiModelProperty(value = "Gets or sets RSA key exponent as Base64 string.")
65+
public String getExponent() {
66+
return exponent;
67+
}
68+
69+
public void setExponent(String exponent) {
70+
this.exponent = exponent;
71+
}
72+
73+
public PublicKeyResponse modulus(String modulus) {
74+
this.modulus = modulus;
75+
return this;
76+
}
77+
78+
/**
79+
* Gets or sets RSA key modulus as Base64 string.
80+
* @return modulus
81+
**/
82+
@ApiModelProperty(value = "Gets or sets RSA key modulus as Base64 string.")
83+
public String getModulus() {
84+
return modulus;
85+
}
86+
87+
public void setModulus(String modulus) {
88+
this.modulus = modulus;
89+
}
90+
91+
@Override
92+
public boolean equals(java.lang.Object o) {
93+
if (this == o) {
94+
return true;
95+
}
96+
if (o == null || getClass() != o.getClass()) {
97+
return false;
98+
}
99+
100+
PublicKeyResponse publicKeyResponse = (PublicKeyResponse) o;
101+
return
102+
Objects.equals(this.exponent, publicKeyResponse.exponent) &&
103+
Objects.equals(this.modulus, publicKeyResponse.modulus) &&
104+
super.equals(o);
105+
}
106+
107+
@Override
108+
public int hashCode() {
109+
return Objects.hash(exponent, modulus, super.hashCode());
110+
}
111+
112+
@Override
113+
public String toString() {
114+
StringBuilder sb = new StringBuilder();
115+
sb.append("class PublicKeyResponse {\n");
116+
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
117+
sb.append(" exponent: ").append(toIndentedString(exponent)).append("\n");
118+
sb.append(" modulus: ").append(toIndentedString(modulus)).append("\n");
119+
sb.append("}");
120+
return sb.toString();
121+
}
122+
123+
/**
124+
* Convert the given object to string with each line indented by 4 spaces
125+
* (except the first line).
126+
*/
127+
private String toIndentedString(java.lang.Object o) {
128+
if (o == null) {
129+
return "null";
130+
}
131+
return o.toString().replace("\n", "\n ");
132+
}
133+
}

src/main/java/com/aspose/words/cloud/model/SaveOptionsData.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public Dml3DEffectsRenderingModeEnum read(final JsonReader jsonReader) throws IO
111111
@SerializedName("FileName")
112112
private String fileName = null;
113113

114+
@SerializedName("ImlRenderingMode")
115+
private String imlRenderingMode = null;
116+
114117
@SerializedName("SaveFormat")
115118
private String saveFormat = null;
116119

@@ -240,6 +243,24 @@ public void setFileName(String fileName) {
240243
this.fileName = fileName;
241244
}
242245

246+
public SaveOptionsData imlRenderingMode(String imlRenderingMode) {
247+
this.imlRenderingMode = imlRenderingMode;
248+
return this;
249+
}
250+
251+
/**
252+
* Gets or sets the value determining how ink (InkML) objects are rendered.
253+
* @return imlRenderingMode
254+
**/
255+
@ApiModelProperty(value = "Gets or sets the value determining how ink (InkML) objects are rendered.")
256+
public String getImlRenderingMode() {
257+
return imlRenderingMode;
258+
}
259+
260+
public void setImlRenderingMode(String imlRenderingMode) {
261+
this.imlRenderingMode = imlRenderingMode;
262+
}
263+
243264
public SaveOptionsData saveFormat(String saveFormat) {
244265
this.saveFormat = saveFormat;
245266
return this;
@@ -385,6 +406,7 @@ public boolean equals(java.lang.Object o) {
385406
Objects.equals(this.dmlEffectsRenderingMode, saveOptionsData.dmlEffectsRenderingMode) &&
386407
Objects.equals(this.dmlRenderingMode, saveOptionsData.dmlRenderingMode) &&
387408
Objects.equals(this.fileName, saveOptionsData.fileName) &&
409+
Objects.equals(this.imlRenderingMode, saveOptionsData.imlRenderingMode) &&
388410
Objects.equals(this.saveFormat, saveOptionsData.saveFormat) &&
389411
Objects.equals(this.updateCreatedTimeProperty, saveOptionsData.updateCreatedTimeProperty) &&
390412
Objects.equals(this.updateFields, saveOptionsData.updateFields) &&
@@ -396,7 +418,7 @@ public boolean equals(java.lang.Object o) {
396418

397419
@Override
398420
public int hashCode() {
399-
return Objects.hash(allowEmbeddingPostScriptFonts, customTimeZoneInfoData, dml3DEffectsRenderingMode, dmlEffectsRenderingMode, dmlRenderingMode, fileName, saveFormat, updateCreatedTimeProperty, updateFields, updateLastPrintedProperty, updateLastSavedTimeProperty, updateSdtContent, zipOutput);
421+
return Objects.hash(allowEmbeddingPostScriptFonts, customTimeZoneInfoData, dml3DEffectsRenderingMode, dmlEffectsRenderingMode, dmlRenderingMode, fileName, imlRenderingMode, saveFormat, updateCreatedTimeProperty, updateFields, updateLastPrintedProperty, updateLastSavedTimeProperty, updateSdtContent, zipOutput);
400422
}
401423

402424
@Override
@@ -409,6 +431,7 @@ public String toString() {
409431
sb.append(" dmlEffectsRenderingMode: ").append(toIndentedString(dmlEffectsRenderingMode)).append("\n");
410432
sb.append(" dmlRenderingMode: ").append(toIndentedString(dmlRenderingMode)).append("\n");
411433
sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n");
434+
sb.append(" imlRenderingMode: ").append(toIndentedString(imlRenderingMode)).append("\n");
412435
sb.append(" saveFormat: ").append(toIndentedString(saveFormat)).append("\n");
413436
sb.append(" updateCreatedTimeProperty: ").append(toIndentedString(updateCreatedTimeProperty)).append("\n");
414437
sb.append(" updateFields: ").append(toIndentedString(updateFields)).append("\n");

0 commit comments

Comments
 (0)