Skip to content

Commit 0a2d382

Browse files
Merge branch 'master' into release
2 parents 3c800ff + 9c547f3 commit 0a2d382

File tree

6 files changed

+93
-5
lines changed

6 files changed

+93
-5
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ 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.6
17+
18+
- Implemented beta version of CompareDocumentOnline feature with both document sending in request
19+
- CompareDocument method now can handle PDF files
20+
- AcceptAllRevisionsBeforeComparison option introduced which is used to specify if accept all revisions before comparison
21+
22+
1623
## Enhancements in Version 21.5
1724

1825
- Update dependencies in sdk
@@ -141,7 +148,7 @@ Add this dependency to your project's POM:
141148
<dependency>
142149
<groupId>com.aspose</groupId>
143150
<artifactId>aspose-words-cloud</artifactId>
144-
<version>21.5.0</version>
151+
<version>21.6.0</version>
145152
</dependency>
146153
</dependencies>
147154
```

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.5.0</version>
7+
<version>21.6.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.5";
59+
private String clientVersion = "21.6";
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/model/CompareOptions.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public TargetEnum read(final JsonReader jsonReader) throws IOException {
9393
}
9494
}
9595

96+
@SerializedName("AcceptAllRevisionsBeforeComparison")
97+
private Boolean acceptAllRevisionsBeforeComparison = null;
98+
9699
@SerializedName("IgnoreCaseChanges")
97100
private Boolean ignoreCaseChanges = null;
98101

@@ -119,6 +122,24 @@ public TargetEnum read(final JsonReader jsonReader) throws IOException {
119122

120123
@SerializedName("Target")
121124
private TargetEnum target = null;
125+
public CompareOptions acceptAllRevisionsBeforeComparison(Boolean acceptAllRevisionsBeforeComparison) {
126+
this.acceptAllRevisionsBeforeComparison = acceptAllRevisionsBeforeComparison;
127+
return this;
128+
}
129+
130+
/**
131+
* Gets or sets whether accept revisions before comparison or not.
132+
* @return acceptAllRevisionsBeforeComparison
133+
**/
134+
@ApiModelProperty(value = "Gets or sets whether accept revisions before comparison or not.")
135+
public Boolean getAcceptAllRevisionsBeforeComparison() {
136+
return acceptAllRevisionsBeforeComparison;
137+
}
138+
139+
public void setAcceptAllRevisionsBeforeComparison(Boolean acceptAllRevisionsBeforeComparison) {
140+
this.acceptAllRevisionsBeforeComparison = acceptAllRevisionsBeforeComparison;
141+
}
142+
122143
public CompareOptions ignoreCaseChanges(Boolean ignoreCaseChanges) {
123144
this.ignoreCaseChanges = ignoreCaseChanges;
124145
return this;
@@ -292,6 +313,7 @@ public boolean equals(java.lang.Object o) {
292313

293314
CompareOptions compareOptions = (CompareOptions) o;
294315
return
316+
Objects.equals(this.acceptAllRevisionsBeforeComparison, compareOptions.acceptAllRevisionsBeforeComparison) &&
295317
Objects.equals(this.ignoreCaseChanges, compareOptions.ignoreCaseChanges) &&
296318
Objects.equals(this.ignoreComments, compareOptions.ignoreComments) &&
297319
Objects.equals(this.ignoreFields, compareOptions.ignoreFields) &&
@@ -305,13 +327,14 @@ public boolean equals(java.lang.Object o) {
305327

306328
@Override
307329
public int hashCode() {
308-
return Objects.hash(ignoreCaseChanges, ignoreComments, ignoreFields, ignoreFootnotes, ignoreFormatting, ignoreHeadersAndFooters, ignoreTables, ignoreTextboxes, target);
330+
return Objects.hash(acceptAllRevisionsBeforeComparison, ignoreCaseChanges, ignoreComments, ignoreFields, ignoreFootnotes, ignoreFormatting, ignoreHeadersAndFooters, ignoreTables, ignoreTextboxes, target);
309331
}
310332

311333
@Override
312334
public String toString() {
313335
StringBuilder sb = new StringBuilder();
314336
sb.append("class CompareOptions {\n");
337+
sb.append(" acceptAllRevisionsBeforeComparison: ").append(toIndentedString(acceptAllRevisionsBeforeComparison)).append("\n");
315338
sb.append(" ignoreCaseChanges: ").append(toIndentedString(ignoreCaseChanges)).append("\n");
316339
sb.append(" ignoreComments: ").append(toIndentedString(ignoreComments)).append("\n");
317340
sb.append(" ignoreFields: ").append(toIndentedString(ignoreFields)).append("\n");

src/main/java/com/aspose/words/cloud/model/requests/CompareDocumentOnlineRequest.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public class CompareDocumentOnlineRequest implements RequestIfc {
5151
*/
5252
private CompareData compareData;
5353

54+
/*
55+
* The comparing document.
56+
*/
57+
private byte[] comparingDocument;
58+
5459
/*
5560
* Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
5661
*/
@@ -71,13 +76,15 @@ public class CompareDocumentOnlineRequest implements RequestIfc {
7176
*
7277
* @param byte[] document The document.
7378
* @param CompareData compareData Compare data.
79+
* @param byte[] comparingDocument The comparing document.
7480
* @param String loadEncoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
7581
* @param String password Password for opening an encrypted document.
7682
* @param String destFileName Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
7783
*/
78-
public CompareDocumentOnlineRequest(byte[] document, CompareData compareData, String loadEncoding, String password, String destFileName) {
84+
public CompareDocumentOnlineRequest(byte[] document, CompareData compareData, byte[] comparingDocument, String loadEncoding, String password, String destFileName) {
7985
this.document = document;
8086
this.compareData = compareData;
87+
this.comparingDocument = comparingDocument;
8188
this.loadEncoding = loadEncoding;
8289
this.password = password;
8390
this.destFileName = destFileName;
@@ -111,6 +118,20 @@ public void setCompareData(CompareData value) {
111118
this.compareData = value;
112119
}
113120

121+
/*
122+
* Gets The comparing document.
123+
*/
124+
public byte[] getComparingDocument() {
125+
return this.comparingDocument;
126+
}
127+
128+
/*
129+
* Sets The comparing document.
130+
*/
131+
public void setComparingDocument(byte[] value) {
132+
this.comparingDocument = value;
133+
}
134+
114135
/*
115136
* Gets Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
116137
*/
@@ -193,6 +214,9 @@ public Request buildHttpRequest(ApiClient apiClient, final ProgressResponseBody.
193214
if (getCompareData() != null)
194215
localVarFormParams.put("CompareData", getCompareData());
195216

217+
if (getComparingDocument() != null)
218+
localVarFormParams.put("ComparingDocument", getComparingDocument());
219+
196220
final String[] localVarAccepts = {
197221
"application/xml", "application/json"
198222
};

src/test/java/com/aspose/words/cloud/api/document/TestCompareDocument.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,40 @@ public void testCompareDocumentOnline() throws ApiException, MessagingException,
121121
requestCompareData,
122122
null,
123123
null,
124+
null,
125+
TestInitializer.RemoteTestOut + "/TestCompareDocumentOut.doc"
126+
);
127+
128+
CompareDocumentOnlineResponse result = TestInitializer.wordsApi.compareDocumentOnline(request);
129+
assertNotNull(result);
130+
}
131+
132+
/*
133+
* Test for document comparison online.
134+
*/
135+
@Test
136+
public void testCompareTwoDocumentOnline() throws ApiException, MessagingException, IOException
137+
{
138+
String localName1 = "compareTestDoc1.doc";
139+
String localName2 = "compareTestDoc2.doc";
140+
String remoteName2 = "TestCompareDocument2.doc";
141+
142+
TestInitializer.UploadFile(
143+
PathUtil.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName2),
144+
remoteFolder + "/" + remoteName2
145+
);
146+
147+
CompareData requestCompareData = new CompareData();
148+
requestCompareData.setAuthor("author");
149+
requestCompareData.setComparingWithDocument(remoteFolder + "/" + remoteName2);
150+
requestCompareData.setDateTime(OffsetDateTime.of(2015, 10, 26, 0, 0, 0, 0, ZoneOffset.UTC));
151+
152+
CompareDocumentOnlineRequest request = new CompareDocumentOnlineRequest(
153+
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName1).toAbsolutePath()),
154+
requestCompareData,
155+
Files.readAllBytes(Paths.get(TestInitializer.LocalTestFolder, localFolder + "/" + localName2).toAbsolutePath()),
156+
null,
157+
null,
124158
TestInitializer.RemoteTestOut + "/TestCompareDocumentOut.doc"
125159
);
126160

0 commit comments

Comments
 (0)