Skip to content

Commit a73e808

Browse files
committed
Updated sources
1 parent d347154 commit a73e808

File tree

6 files changed

+360
-12
lines changed

6 files changed

+360
-12
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# GroupDocs.Conversion Cloud SDK for Java
2+
23
This repository contains GroupDocs.Conversion Cloud SDK for Java source code. This SDK allows you to work with GroupDocs.Conversion Cloud REST APIs in your Java applications.
34

45
## Requirements
@@ -37,7 +38,7 @@ Add following repository and dependency to your project's POM
3738
<dependency>
3839
<groupId>com.groupdocs</groupId>
3940
<artifactId>groupdocs-conversion-cloud</artifactId>
40-
<version>20.3</version>
41+
<version>20.11</version>
4142
<scope>compile</scope>
4243
</dependency>
4344
```
@@ -50,7 +51,7 @@ At first generate the JAR by executing:
5051

5152
Then manually install the following JARs:
5253

53-
* target/groupdocs-conversion-cloud-20.3.jar
54+
* target/groupdocs-conversion-cloud-20.11.jar
5455
* target/lib/*.jar
5556

5657
## Getting Started
@@ -92,6 +93,17 @@ public class ApiExample {
9293
```
9394

9495
## Licensing
96+
9597
All GroupDocs.Conversion Cloud SDKs are licensed under [MIT License](LICENSE).
9698

97-
[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/conversion/java) | [Docs](https://docs.groupdocs.cloud/conversion/) | [Demos](https://products.groupdocs.app/conversion/family) | [API Reference](https://apireference.groupdocs.cloud/conversion/) | [Examples](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java-samples) | [Blog](https://blog.groupdocs.cloud/category/conversion/) | [Free Support](https://forum.groupdocs.cloud/c/conversion) | [Free Trial](https://purchase.groupdocs.cloud/trial)
99+
## Resources
100+
101+
+[**Website**](https://www.groupdocs.cloud)
102+
+[**Product Home**](https://products.groupdocs.cloud/conversion)
103+
+[**Documentation**](https://docs.groupdocs.cloud/conversion)
104+
+[**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion)
105+
+[**Blog**](https://blog.groupdocs.cloud/category/conversion)
106+
107+
## Contact Us
108+
109+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/conversion).

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>groupdocs-conversion-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>groupdocs-conversion-cloud</name>
8-
<version>20.3</version>
8+
<version>20.11</version>
99
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java</url>
1010
<description>Java library for communicating with the GroupDocs.Conversion Cloud API</description>
1111
<scm>
@@ -334,7 +334,7 @@
334334
<gson-version>2.8.1</gson-version>
335335
<threetenbp-version>1.3.5</threetenbp-version>
336336
<maven-plugin-version>1.0.0</maven-plugin-version>
337-
<junit-version>4.12</junit-version>
337+
<junit-version>4.13.1</junit-version>
338338
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
339339
</properties>
340340
</project>

src/main/java/com/groupdocs/cloud/conversion/api/ConvertApi.java

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,5 +322,141 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
322322
return call;
323323
}
324324

325+
/**
326+
* Build call for convertDocumentDirect
327+
* @param request The request model
328+
* @param progressListener Progress listener
329+
* @param progressRequestListener Progress request listener
330+
* @return Call to execute
331+
* @throws ApiException If fail to serialize the request body object
332+
*/
333+
public com.squareup.okhttp.Call convertDocumentDirectCall(ConvertDocumentDirectRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
334+
Object localVarPostBody = null;
335+
336+
// create path and map variables
337+
String localVarPath = "/conversion";
338+
339+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
340+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
341+
if (request.getformat() != null)
342+
localVarQueryParams.addAll(apiClient.parameterToPair("format", request.getformat()));
343+
if (request.getfromPage() != null)
344+
localVarQueryParams.addAll(apiClient.parameterToPair("fromPage", request.getfromPage()));
345+
if (request.getpagesCount() != null)
346+
localVarQueryParams.addAll(apiClient.parameterToPair("pagesCount", request.getpagesCount()));
347+
348+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
349+
350+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
351+
if (request.getFile() != null)
352+
localVarFormParams.put("File", request.getFile());
353+
354+
final String[] localVarAccepts = {
355+
"application/json"
356+
};
357+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
358+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
359+
360+
final String[] localVarContentTypes = {
361+
"multipart/form-data"
362+
};
363+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
364+
localVarHeaderParams.put("Content-Type", localVarContentType);
365+
366+
if(progressListener != null) {
367+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
368+
@Override
369+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
370+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
371+
return originalResponse.newBuilder()
372+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
373+
.build();
374+
}
375+
});
376+
}
377+
378+
String[] localVarAuthNames = new String[] { "JWT" };
379+
return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
380+
}
381+
382+
@SuppressWarnings("rawtypes")
383+
private com.squareup.okhttp.Call convertDocumentDirectValidateBeforeCall(ConvertDocumentDirectRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
384+
385+
// verify the required parameter 'format' is set
386+
if (request.getformat() == null) {
387+
throw new ApiException("Missing the required parameter 'format' when calling convertDocumentDirect(Async)");
388+
}
389+
390+
// verify the required parameter 'file' is set
391+
if (request.getFile() == null) {
392+
throw new ApiException("Missing the required parameter 'file' when calling convertDocumentDirect(Async)");
393+
}
394+
395+
396+
com.squareup.okhttp.Call call = convertDocumentDirectCall(request, progressListener, progressRequestListener);
397+
return call;
398+
399+
}
400+
401+
/**
402+
* Converts input document file to format specified
403+
*
404+
* @param request The request model
405+
* @return File
406+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
407+
*/
408+
public File convertDocumentDirect(ConvertDocumentDirectRequest request) throws ApiException {
409+
ApiResponse<File> resp = convertDocumentDirectWithHttpInfo(request);
410+
return resp.getData();
411+
}
412+
413+
/**
414+
* Converts input document file to format specified
415+
*
416+
* @param request The request model
417+
* @return ApiResponse&lt;File&gt;
418+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
419+
*/
420+
public ApiResponse<File> convertDocumentDirectWithHttpInfo(ConvertDocumentDirectRequest request) throws ApiException {
421+
com.squareup.okhttp.Call call = convertDocumentDirectValidateBeforeCall(request, null, null);
422+
Type localVarReturnType = new TypeToken<File>(){}.getType();
423+
return apiClient.execute(call, localVarReturnType);
424+
}
425+
426+
/**
427+
* Converts input document file to format specified (asynchronously)
428+
*
429+
* @param request The request model
430+
* @param callback The callback to be executed when the API call finishes
431+
* @return The request call
432+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
433+
*/
434+
public com.squareup.okhttp.Call convertDocumentDirectAsync(ConvertDocumentDirectRequest request, final ApiCallback<File> callback) throws ApiException {
435+
436+
ProgressResponseBody.ProgressListener progressListener = null;
437+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
438+
439+
if (callback != null) {
440+
progressListener = new ProgressResponseBody.ProgressListener() {
441+
@Override
442+
public void update(long bytesRead, long contentLength, boolean done) {
443+
callback.onDownloadProgress(bytesRead, contentLength, done);
444+
}
445+
};
446+
447+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
448+
@Override
449+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
450+
callback.onUploadProgress(bytesWritten, contentLength, done);
451+
}
452+
};
453+
}
454+
455+
com.squareup.okhttp.Call call = convertDocumentDirectValidateBeforeCall(request, progressListener, progressRequestListener);
456+
Type localVarReturnType = new TypeToken<File>(){}.getType();
457+
apiClient.executeAsync(call, localVarReturnType, callback);
458+
return call;
459+
}
460+
325461
}
326462

src/main/java/com/groupdocs/cloud/conversion/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ApiClient(Configuration configuration) {
9797
this.json = new JSON();
9898

9999
// Set default User-Agent.
100-
setUserAgent("java-sdk/20.3");
100+
setUserAgent("java-sdk/20.11");
101101

102102
// Set connection timeout
103103
setConnectTimeout(configuration.getTimeout());
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
/**
2+
* --------------------------------------------------------------------------------------------------------------------
3+
* <copyright company="Aspose Pty Ltd" file="ConvertDocumentDirectRequest.java">
4+
* Copyright (c) 2003-2018 Aspose Pty Ltd
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.groupdocs.cloud.conversion.model.requests;
29+
30+
import java.util.Objects;
31+
import com.google.gson.TypeAdapter;
32+
import com.google.gson.annotations.JsonAdapter;
33+
import com.google.gson.annotations.SerializedName;
34+
import com.google.gson.stream.JsonReader;
35+
import com.google.gson.stream.JsonWriter;
36+
import com.groupdocs.cloud.conversion.model.*;
37+
import io.swagger.annotations.ApiModel;
38+
import io.swagger.annotations.ApiModelProperty;
39+
import java.io.IOException;
40+
import java.io.File;
41+
42+
/**
43+
* Request model for convertDocumentDirect method.
44+
*/
45+
public class ConvertDocumentDirectRequest {
46+
47+
/**
48+
* Initializes a new instance of the ConvertDocumentDirectRequest class.
49+
*/
50+
public ConvertDocumentDirectRequest()
51+
{
52+
}
53+
54+
/**
55+
* Initializes a new instance of the ConvertDocumentDirectRequest class.
56+
* @param format Requested conversion format
57+
* @param file Input file to convert
58+
* @param fromPage Page start conversion from
59+
* @param pagesCount Number of pages to convert
60+
*/
61+
public ConvertDocumentDirectRequest(String format, File file, Integer fromPage, Integer pagesCount)
62+
{
63+
this.format = format;
64+
this.file = file;
65+
this.fromPage = fromPage;
66+
this.pagesCount = pagesCount;
67+
}
68+
69+
@SerializedName("format")
70+
private String format = null;
71+
72+
@SerializedName("file")
73+
private File file = null;
74+
75+
@SerializedName("fromPage")
76+
private Integer fromPage = null;
77+
78+
@SerializedName("pagesCount")
79+
private Integer pagesCount = null;
80+
81+
/**
82+
* Requested conversion format
83+
* @return Requested conversion format
84+
**/
85+
@ApiModelProperty(example = "format_example", required = true, value = "Requested conversion format")
86+
public String getformat() {
87+
return format;
88+
}
89+
90+
public void setformat(String format) {
91+
this.format = format;
92+
}
93+
94+
/**
95+
* Input file to convert
96+
* @return Input file to convert
97+
**/
98+
@ApiModelProperty(example = "new File(&quot;/path/to/file.txt&quot;)", required = true, value = "Input file to convert")
99+
public File getFile() {
100+
return file;
101+
}
102+
103+
public void setFile(File file) {
104+
this.file = file;
105+
}
106+
107+
/**
108+
* Page start conversion from
109+
* @return Page start conversion from
110+
**/
111+
@ApiModelProperty(example = "1", value = "Page start conversion from")
112+
public Integer getfromPage() {
113+
return fromPage;
114+
}
115+
116+
public void setfromPage(Integer fromPage) {
117+
this.fromPage = fromPage;
118+
}
119+
120+
/**
121+
* Number of pages to convert
122+
* @return Number of pages to convert
123+
**/
124+
@ApiModelProperty(example = "0", value = "Number of pages to convert")
125+
public Integer getpagesCount() {
126+
return pagesCount;
127+
}
128+
129+
public void setpagesCount(Integer pagesCount) {
130+
this.pagesCount = pagesCount;
131+
}
132+
133+
@Override
134+
public boolean equals(java.lang.Object o) {
135+
if (this == o) {
136+
return true;
137+
}
138+
139+
if (o == null || getClass() != o.getClass()) {
140+
return false;
141+
}
142+
143+
ConvertDocumentDirectRequest request = (ConvertDocumentDirectRequest) o;
144+
return Objects.equals(this.format, request.format) &&
145+
Objects.equals(this.file, request.file) &&
146+
Objects.equals(this.fromPage, request.fromPage) &&
147+
Objects.equals(this.pagesCount, request.pagesCount);
148+
}
149+
150+
@Override
151+
public int hashCode() {
152+
return Objects.hash(format, file, fromPage, pagesCount);
153+
}
154+
155+
@Override
156+
public String toString() {
157+
StringBuilder sb = new StringBuilder();
158+
sb.append("class ConvertDocumentDirect {\n");
159+
sb.append(" format: ").append(toIndentedString(format)).append("\n");
160+
sb.append(" file: ").append(toIndentedString(file)).append("\n");
161+
sb.append(" fromPage: ").append(toIndentedString(fromPage)).append("\n");
162+
sb.append(" pagesCount: ").append(toIndentedString(pagesCount)).append("\n");
163+
sb.append("}");
164+
return sb.toString();
165+
}
166+
167+
/**
168+
* Convert the given object to string with each line indented by 4 spaces
169+
* (except the first line).
170+
*/
171+
private String toIndentedString(java.lang.Object o) {
172+
if (o == null) {
173+
return "null";
174+
}
175+
return o.toString().replace("\n", "\n ");
176+
}
177+
}
178+

0 commit comments

Comments
 (0)