Skip to content

Commit b5180b1

Browse files
Merge branch 'master' into release
2 parents 4ba6047 + 950554c commit b5180b1

File tree

19 files changed

+1634
-23
lines changed

19 files changed

+1634
-23
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ 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 22.7
17+
18+
- Expand 'AppendDocument' API method to support 'ImageEntryList' for directly appending images to documents and another images.
19+
- Added 'CompressDocument' API method to support compression and resizing images inside the document for reduce the size of the document.
20+
21+
1622
## Enhancements in Version 22.6
1723

1824
- Added 'DeleteBookmark' and 'DeleteBookmarkOnline' API methods for delete bookmarks by name from the document.
@@ -225,7 +231,7 @@ Add this dependency to your project's POM:
225231
<dependency>
226232
<groupId>com.aspose</groupId>
227233
<artifactId>aspose-words-cloud</artifactId>
228-
<version>22.6.0</version>
234+
<version>22.7.0</version>
229235
</dependency>
230236
</dependencies>
231237
```
232 KB
Binary file not shown.

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>22.6.0</version>
7+
<version>22.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
@@ -58,7 +58,7 @@ public class ApiClient {
5858
private String apiVersion = "v4.0";
5959
private String baseUrl = "https://api.aspose.cloud";
6060
private String basePath = baseUrl + "/" + apiVersion;
61-
private String clientVersion = "22.6";
61+
private String clientVersion = "22.7";
6262
private boolean debugging = false;
6363
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
6464
private String tempFolderPath = null;

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

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,152 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
10161016
return call;
10171017
}
10181018

1019+
@SuppressWarnings("rawtypes")
1020+
private com.squareup.okhttp.Call compressDocumentValidateBeforeCall(CompressDocumentRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
1021+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
1022+
}
1023+
1024+
/**
1025+
* The default settings allows to reduce the size of the document without any visible degradation of images quality.
1026+
* @param request Request object
1027+
* @return CompressResponse
1028+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1029+
* @throws IOException If fail to serialize the request body object
1030+
*/
1031+
public CompressResponse compressDocument(CompressDocumentRequest request) throws ApiException, MessagingException, IOException {
1032+
try {
1033+
ApiResponse< CompressResponse > resp = compressDocumentWithHttpInfo(request);
1034+
return resp.getData();
1035+
}
1036+
catch (ApiException ex) {
1037+
if (ex.getCode() == apiClient.getNotAuthCode()) {
1038+
apiClient.requestToken();
1039+
ApiResponse< CompressResponse > resp = compressDocumentWithHttpInfo(request);
1040+
return resp.getData();
1041+
}
1042+
throw ex;
1043+
}
1044+
}
1045+
1046+
/**
1047+
* The default settings allows to reduce the size of the document without any visible degradation of images quality.
1048+
* @param request Request object
1049+
* @return ApiResponse< CompressResponse >;
1050+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1051+
* @throws IOException If fail to serialize the request body object
1052+
*/
1053+
private ApiResponse< CompressResponse > compressDocumentWithHttpInfo(CompressDocumentRequest request) throws ApiException, MessagingException, IOException {
1054+
com.squareup.okhttp.Call call = compressDocumentValidateBeforeCall(request, null, null);
1055+
return apiClient.execute(call, request);
1056+
}
1057+
1058+
/**
1059+
* The default settings allows to reduce the size of the document without any visible degradation of images quality. (asynchronously)
1060+
* @param request Request object
1061+
* @param callback The callback to be executed when the API call finishes
1062+
* @return The request call
1063+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1064+
* @throws IOException If fail to serialize the request body object
1065+
*/
1066+
public com.squareup.okhttp.Call compressDocumentAsync(CompressDocumentRequest request, final ApiCallback< CompressResponse > callback) throws ApiException, MessagingException, IOException {
1067+
1068+
ProgressResponseBody.ProgressListener progressListener = null;
1069+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1070+
1071+
if (callback != null) {
1072+
progressListener = new ProgressResponseBody.ProgressListener() {
1073+
@Override
1074+
public void update(long bytesRead, long contentLength, boolean done) {
1075+
callback.onDownloadProgress(bytesRead, contentLength, done);
1076+
}
1077+
};
1078+
1079+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1080+
@Override
1081+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1082+
callback.onUploadProgress(bytesWritten, contentLength, done);
1083+
}
1084+
};
1085+
}
1086+
1087+
com.squareup.okhttp.Call call = compressDocumentValidateBeforeCall(request, progressListener, progressRequestListener);
1088+
apiClient.executeAsync(call, request, callback);
1089+
return call;
1090+
}
1091+
1092+
@SuppressWarnings("rawtypes")
1093+
private com.squareup.okhttp.Call compressDocumentOnlineValidateBeforeCall(CompressDocumentOnlineRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
1094+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
1095+
}
1096+
1097+
/**
1098+
* Compress and resize images inside the document.
1099+
* @param request Request object
1100+
* @return CompressDocumentOnlineResponse
1101+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1102+
* @throws IOException If fail to serialize the request body object
1103+
*/
1104+
public CompressDocumentOnlineResponse compressDocumentOnline(CompressDocumentOnlineRequest request) throws ApiException, MessagingException, IOException {
1105+
try {
1106+
ApiResponse< CompressDocumentOnlineResponse > resp = compressDocumentOnlineWithHttpInfo(request);
1107+
return resp.getData();
1108+
}
1109+
catch (ApiException ex) {
1110+
if (ex.getCode() == apiClient.getNotAuthCode()) {
1111+
apiClient.requestToken();
1112+
ApiResponse< CompressDocumentOnlineResponse > resp = compressDocumentOnlineWithHttpInfo(request);
1113+
return resp.getData();
1114+
}
1115+
throw ex;
1116+
}
1117+
}
1118+
1119+
/**
1120+
* Compress and resize images inside the document.
1121+
* @param request Request object
1122+
* @return ApiResponse< CompressDocumentOnlineResponse >;
1123+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1124+
* @throws IOException If fail to serialize the request body object
1125+
*/
1126+
private ApiResponse< CompressDocumentOnlineResponse > compressDocumentOnlineWithHttpInfo(CompressDocumentOnlineRequest request) throws ApiException, MessagingException, IOException {
1127+
com.squareup.okhttp.Call call = compressDocumentOnlineValidateBeforeCall(request, null, null);
1128+
return apiClient.execute(call, request);
1129+
}
1130+
1131+
/**
1132+
* Compress and resize images inside the document. (asynchronously)
1133+
* @param request Request object
1134+
* @param callback The callback to be executed when the API call finishes
1135+
* @return The request call
1136+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1137+
* @throws IOException If fail to serialize the request body object
1138+
*/
1139+
public com.squareup.okhttp.Call compressDocumentOnlineAsync(CompressDocumentOnlineRequest request, final ApiCallback< CompressDocumentOnlineResponse > callback) throws ApiException, MessagingException, IOException {
1140+
1141+
ProgressResponseBody.ProgressListener progressListener = null;
1142+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
1143+
1144+
if (callback != null) {
1145+
progressListener = new ProgressResponseBody.ProgressListener() {
1146+
@Override
1147+
public void update(long bytesRead, long contentLength, boolean done) {
1148+
callback.onDownloadProgress(bytesRead, contentLength, done);
1149+
}
1150+
};
1151+
1152+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
1153+
@Override
1154+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
1155+
callback.onUploadProgress(bytesWritten, contentLength, done);
1156+
}
1157+
};
1158+
}
1159+
1160+
com.squareup.okhttp.Call call = compressDocumentOnlineValidateBeforeCall(request, progressListener, progressRequestListener);
1161+
apiClient.executeAsync(call, request, callback);
1162+
return call;
1163+
}
1164+
10191165
@SuppressWarnings("rawtypes")
10201166
private com.squareup.okhttp.Call convertDocumentValidateBeforeCall(ConvertDocumentRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
10211167
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="BaseEntry.java">
4+
* Copyright (c) 2022 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+
* Represents a entry which will be appended to the original resource document.
47+
*/
48+
@ApiModel(description = "Represents a entry which will be appended to the original resource document.")
49+
public class BaseEntry {
50+
@SerializedName("Href")
51+
protected String href;
52+
/**
53+
* Gets or sets the path to entry to append at the server.
54+
* @return href
55+
**/
56+
@ApiModelProperty(value = "Gets or sets the path to entry to append at the server.")
57+
public String getHref() {
58+
return href;
59+
}
60+
61+
public BaseEntry href(String href) {
62+
this.href = href;
63+
return this;
64+
}
65+
66+
public void setHref(String href) {
67+
this.href = href;
68+
}
69+
70+
71+
public BaseEntry() {
72+
this.href = null;
73+
}
74+
75+
@Override
76+
public boolean equals(java.lang.Object o) {
77+
if (this == o) {
78+
return true;
79+
}
80+
if (o == null || getClass() != o.getClass()) {
81+
return false;
82+
}
83+
84+
BaseEntry baseEntry = (BaseEntry) o;
85+
return
86+
Objects.equals(this.href, baseEntry.href);
87+
}
88+
89+
@Override
90+
public int hashCode() {
91+
return Objects.hash(href);
92+
}
93+
94+
@Override
95+
public String toString() {
96+
StringBuilder sb = new StringBuilder();
97+
sb.append("class BaseEntry {\n");
98+
sb.append(" href: ").append(toIndentedString(getHref())).append("\n");
99+
sb.append("}");
100+
return sb.toString();
101+
}
102+
103+
/**
104+
* Convert the given object to string with each line indented by 4 spaces
105+
* (except the first line).
106+
*/
107+
private String toIndentedString(java.lang.Object o) {
108+
if (o == null) {
109+
return "null";
110+
}
111+
return o.toString().replace("\n", "\n ");
112+
}
113+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="BaseEntryList.java">
4+
* Copyright (c) 2022 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+
* Represents a list of entries which will be appended to the original resource entry.
47+
*/
48+
@ApiModel(description = "Represents a list of entries which will be appended to the original resource entry.")
49+
public abstract class BaseEntryList {
50+
51+
public BaseEntryList() {
52+
}
53+
54+
@Override
55+
public boolean equals(java.lang.Object o) {
56+
if (this == o) {
57+
return true;
58+
}
59+
if (o == null || getClass() != o.getClass()) {
60+
return false;
61+
}
62+
63+
return true;
64+
}
65+
66+
@Override
67+
public int hashCode() {
68+
return Objects.hash();
69+
}
70+
71+
@Override
72+
public String toString() {
73+
StringBuilder sb = new StringBuilder();
74+
sb.append("class BaseEntryList {\n");
75+
sb.append("}");
76+
return sb.toString();
77+
}
78+
79+
/**
80+
* Convert the given object to string with each line indented by 4 spaces
81+
* (except the first line).
82+
*/
83+
private String toIndentedString(java.lang.Object o) {
84+
if (o == null) {
85+
return "null";
86+
}
87+
return o.toString().replace("\n", "\n ");
88+
}
89+
}

0 commit comments

Comments
 (0)