Skip to content

Commit fb8f43a

Browse files
SDK regenerated by CI server [ci skip]
1 parent 9b3d661 commit fb8f43a

File tree

7 files changed

+326
-4
lines changed

7 files changed

+326
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Add this dependency to your project's POM:
409409
<dependency>
410410
<groupId>com.aspose</groupId>
411411
<artifactId>aspose-words-cloud</artifactId>
412-
<version>25.9.0</version>
412+
<version>25.10.0</version>
413413
</dependency>
414414
</dependencies>
415415
```

pom.xml

Lines changed: 2 additions & 2 deletions
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>25.9.0</version>
7+
<version>25.10.0</version>
88
<url>https://www.aspose.cloud/</url>
99
<description>Aspose Words Java SDK</description>
1010
<scm>
@@ -320,7 +320,7 @@
320320
<gson-fire-version>1.8.0</gson-fire-version>
321321
<swagger-core-version>1.5.18</swagger-core-version>
322322
<okhttp-version>2.7.5</okhttp-version>
323-
<gson-version>2.8.1</gson-version>
323+
<gson-version>2.8.9</gson-version>
324324
<threetenbp-version>1.3.5</threetenbp-version>
325325
<maven-plugin-version>1.0.0</maven-plugin-version>
326326
<junit-version>4.12</junit-version>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class ApiClient {
5959
private String apiVersion = "v4.0";
6060
private String baseUrl = "https://api.aspose.cloud";
6161
private String basePath = baseUrl + "/" + apiVersion;
62-
private String clientVersion = "25.9";
62+
private String clientVersion = "25.10";
6363
private boolean debugging = false;
6464
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
6565
private String tempFolderPath = null;

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

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18843,6 +18843,79 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
1884318843
return call;
1884418844
}
1884518845

18846+
@SuppressWarnings("rawtypes")
18847+
private com.squareup.okhttp.Call loadWebDocumentOnlineValidateBeforeCall(LoadWebDocumentOnlineRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
18848+
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
18849+
}
18850+
18851+
/**
18852+
* Downloads a document from the Web using URL and saves it to cloud storage in the specified format.
18853+
* @param request Request object
18854+
* @return LoadWebDocumentOnlineResponse
18855+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
18856+
* @throws IOException If fail to serialize the request body object
18857+
*/
18858+
public LoadWebDocumentOnlineResponse loadWebDocumentOnline(LoadWebDocumentOnlineRequest request) throws ApiException, MessagingException, IOException {
18859+
try {
18860+
ApiResponse< LoadWebDocumentOnlineResponse > resp = loadWebDocumentOnlineWithHttpInfo(request);
18861+
return resp.getData();
18862+
}
18863+
catch (ApiException ex) {
18864+
if (ex.getCode() == apiClient.getNotAuthCode()) {
18865+
apiClient.requestToken();
18866+
ApiResponse< LoadWebDocumentOnlineResponse > resp = loadWebDocumentOnlineWithHttpInfo(request);
18867+
return resp.getData();
18868+
}
18869+
throw ex;
18870+
}
18871+
}
18872+
18873+
/**
18874+
* Downloads a document from the Web using URL and saves it to cloud storage in the specified format.
18875+
* @param request Request object
18876+
* @return ApiResponse< LoadWebDocumentOnlineResponse >;
18877+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
18878+
* @throws IOException If fail to serialize the request body object
18879+
*/
18880+
private ApiResponse< LoadWebDocumentOnlineResponse > loadWebDocumentOnlineWithHttpInfo(LoadWebDocumentOnlineRequest request) throws ApiException, MessagingException, IOException {
18881+
com.squareup.okhttp.Call call = loadWebDocumentOnlineValidateBeforeCall(request, null, null);
18882+
return apiClient.execute(call, request);
18883+
}
18884+
18885+
/**
18886+
* Downloads a document from the Web using URL and saves it to cloud storage in the specified format. (asynchronously)
18887+
* @param request Request object
18888+
* @param callback The callback to be executed when the API call finishes
18889+
* @return The request call
18890+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
18891+
* @throws IOException If fail to serialize the request body object
18892+
*/
18893+
public com.squareup.okhttp.Call loadWebDocumentOnlineAsync(LoadWebDocumentOnlineRequest request, final ApiCallback< LoadWebDocumentOnlineResponse > callback) throws ApiException, MessagingException, IOException {
18894+
18895+
ProgressResponseBody.ProgressListener progressListener = null;
18896+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
18897+
18898+
if (callback != null) {
18899+
progressListener = new ProgressResponseBody.ProgressListener() {
18900+
@Override
18901+
public void update(long bytesRead, long contentLength, boolean done) {
18902+
callback.onDownloadProgress(bytesRead, contentLength, done);
18903+
}
18904+
};
18905+
18906+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
18907+
@Override
18908+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
18909+
callback.onUploadProgress(bytesWritten, contentLength, done);
18910+
}
18911+
};
18912+
}
18913+
18914+
com.squareup.okhttp.Call call = loadWebDocumentOnlineValidateBeforeCall(request, progressListener, progressRequestListener);
18915+
apiClient.executeAsync(call, request, callback);
18916+
return call;
18917+
}
18918+
1884618919
@SuppressWarnings("rawtypes")
1884718920
private com.squareup.okhttp.Call mergeWithNextValidateBeforeCall(MergeWithNextRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException, IOException {
1884818921
return apiClient.buildCall(request.buildHttpRequest(apiClient, progressListener, progressRequestListener, true));
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="LoadWebDocumentOnlineRequest.java">
4+
* Copyright (c) 2025 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.requests;
29+
30+
import com.aspose.words.cloud.*;
31+
import com.aspose.words.cloud.model.*;
32+
import com.aspose.words.cloud.model.responses.*;
33+
import com.squareup.okhttp.*;
34+
import jakarta.mail.MessagingException;
35+
import jakarta.mail.internet.MimeMultipart;
36+
import java.io.*;
37+
import java.lang.reflect.Type;
38+
import java.util.*;
39+
40+
/*
41+
* Request model for loadWebDocumentOnline operation.
42+
*/
43+
public class LoadWebDocumentOnlineRequest implements RequestIfc {
44+
/*
45+
* The properties of data downloading.
46+
*/
47+
private LoadWebDocumentData data;
48+
49+
/*
50+
* Initializes a new instance of the LoadWebDocumentOnlineRequest class.
51+
*
52+
* @param LoadWebDocumentData data The properties of data downloading.
53+
*/
54+
public LoadWebDocumentOnlineRequest(LoadWebDocumentData data) {
55+
this.data = data;
56+
}
57+
58+
/*
59+
* Gets The properties of data downloading.
60+
*/
61+
public LoadWebDocumentData getData() {
62+
return this.data;
63+
}
64+
65+
/*
66+
* Sets The properties of data downloading.
67+
*/
68+
public void setData(LoadWebDocumentData value) {
69+
this.data = value;
70+
}
71+
72+
73+
/*
74+
* Creates the http request based on this request model.
75+
*
76+
* @param apiClient ApiClient instance
77+
* @throws ApiException If fail to serialize the request body object
78+
* @throws IOException If fail to serialize the request body object
79+
*/
80+
@Override
81+
public Request buildHttpRequest(ApiClient apiClient, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener, Boolean addAuthHeaders) throws ApiException, IOException {
82+
// verify the required parameter 'Data' is set
83+
if (getData() == null) {
84+
throw new ApiException(apiClient.getBadRequestCode(), "Missing the required parameter 'Data' when calling loadWebDocumentOnline");
85+
}
86+
if (getData() != null) {
87+
getData().validate();
88+
}
89+
90+
91+
// create path and map variables
92+
String localVarPath = "/words/online/put/loadWebDocument";
93+
localVarPath = localVarPath.replaceAll("//", "/");
94+
95+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
96+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
97+
98+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
99+
100+
List<FileReference> localFilesContentParams = new ArrayList<FileReference>();
101+
Map<String, Object> localVarFormParams = new LinkedHashMap<String, Object>();
102+
if (getData() != null) {
103+
localVarFormParams.put("Data", getData());
104+
}
105+
106+
if (progressListener != null) {
107+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
108+
@Override
109+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
110+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
111+
return originalResponse.newBuilder()
112+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
113+
.build();
114+
}
115+
});
116+
}
117+
118+
return apiClient.buildRequest(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarHeaderParams, localVarFormParams, localFilesContentParams, addAuthHeaders, progressRequestListener);
119+
}
120+
121+
/*
122+
* Deserialize response message.
123+
*
124+
* @param apiClient ApiClient instance
125+
* @param response Response instance
126+
*/
127+
@Override
128+
public LoadWebDocumentOnlineResponse deserializeResponse(ApiClient apiClient, Response response) throws ApiException, MessagingException, IOException {
129+
MimeMultipart multipart = apiClient.getMultipartFromResponse(response);
130+
return new LoadWebDocumentOnlineResponse(
131+
(SaveResponse) apiClient.parseModel(apiClient.findBodyPartInMultipart("Model", multipart), SaveResponse.class),
132+
apiClient.parseFilesCollection(apiClient.findBodyPartInMultipart("Document", multipart))
133+
);
134+
}
135+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="LoadWebDocumentOnlineResponse.java">
4+
* Copyright (c) 2025 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.responses;
29+
30+
import com.aspose.words.cloud.model.*;
31+
import java.util.Map;
32+
33+
/*
34+
* Response model for loadWebDocumentOnline operation.
35+
*/
36+
public class LoadWebDocumentOnlineResponse implements IMultipartResponse {
37+
/*
38+
* The REST response with a save result.
39+
*/
40+
private SaveResponse model;
41+
42+
/*
43+
* The document after modification.
44+
*/
45+
private Map<String, byte[]> document;
46+
47+
/*
48+
* Initializes a new instance of the LoadWebDocumentOnlineResponse class.
49+
*/
50+
public LoadWebDocumentOnlineResponse() {
51+
this.model = null;
52+
this.document = null;
53+
}
54+
55+
/*
56+
* Initializes a new instance of the LoadWebDocumentOnlineResponse class.
57+
*/
58+
public LoadWebDocumentOnlineResponse(SaveResponse model, Map<String, byte[]> document) {
59+
this.model = model;
60+
this.document = document;
61+
}
62+
63+
/*
64+
* Gets The REST response with a save result.
65+
*/
66+
public SaveResponse getModel() {
67+
return this.model;
68+
}
69+
70+
/*
71+
* Sets The REST response with a save result.
72+
*/
73+
public void setModel(SaveResponse value) {
74+
this.model = value;
75+
}
76+
77+
/*
78+
* Gets The document after modification.
79+
*/
80+
public Map<String, byte[]> getDocument() {
81+
return this.document;
82+
}
83+
84+
/*
85+
* Sets The document after modification.
86+
*/
87+
public void setDocument(Map<String, byte[]> value) {
88+
this.document = value;
89+
}
90+
}

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,28 @@ public void testLoadWebDocument() throws ApiException, MessagingException, IOExc
7878
assertNotNull(result.getSaveResult().getDestDocument());
7979
assertEquals("google.doc", result.getSaveResult().getDestDocument().getHref());
8080
}
81+
82+
/*
83+
* Test for loading web document online.
84+
*/
85+
@Test
86+
public void testLoadWebDocumentOnline() throws ApiException, MessagingException, IOException
87+
{
88+
DocSaveOptionsData requestDataSaveOptions = new DocSaveOptionsData();
89+
requestDataSaveOptions.setFileName("google.doc");
90+
requestDataSaveOptions.setDmlEffectsRenderingMode(DocSaveOptionsData.DmlEffectsRenderingModeEnum.NONE);
91+
requestDataSaveOptions.setDmlRenderingMode(DocSaveOptionsData.DmlRenderingModeEnum.DRAWINGML);
92+
requestDataSaveOptions.setZipOutput(false);
93+
94+
LoadWebDocumentData requestData = new LoadWebDocumentData();
95+
requestData.setLoadingDocumentUrl("http://google.com");
96+
requestData.setSaveOptions(requestDataSaveOptions);
97+
98+
LoadWebDocumentOnlineRequest request = new LoadWebDocumentOnlineRequest(
99+
requestData
100+
);
101+
102+
LoadWebDocumentOnlineResponse result = TestInitializer.wordsApi.loadWebDocumentOnline(request);
103+
assertNotNull(result);
104+
}
81105
}

0 commit comments

Comments
 (0)