Skip to content

Commit 2397afe

Browse files
committed
Updated sources
1 parent 365a5a9 commit 2397afe

7 files changed

Lines changed: 393 additions & 39 deletions

File tree

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# GroupDocs.Conversion Cloud SDK for Android
2-
This repository contains GroupDocs.Conversion Cloud SDK for Android source code. This SDK allows you to work with GroupDocs.Conversion Cloud REST APIs in your Android applications on Java language.
32

3+
This repository contains GroupDocs.Conversion Cloud SDK for Android source code. This SDK allows you to work with GroupDocs.Conversion Cloud REST APIs in your Android applications on Java language.
44

55
## Installation
6+
67
Add Internet permission in the AndroidManifest.xml. Example:
8+
79
```xml
810
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<package name>">
911
<uses-permission android:name="android.permission.INTERNET" />
@@ -12,7 +14,8 @@ Add Internet permission in the AndroidManifest.xml. Example:
1214

1315
Add following repository and dependency to your android module's build.gradle
1416
after "apply plugin: 'com.android.application'" section:
15-
```
17+
18+
```javascript
1619
repositories {
1720
maven {
1821
url "https://repository.groupdocs.cloud/repo/"
@@ -37,7 +40,7 @@ import com.groupdocs.cloud.conversion.api.InfoApi;
3740

3841

3942
public class ApiExample {
40-
43+
4144
public static void getSupportedFormats() {
4245

4346
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
@@ -53,18 +56,27 @@ public class ApiExample {
5356
for (Format format : response.getFormats()) {
5457
System.out.println(format.getFileFormat());
5558
}
56-
5759
} catch (ApiException e) {
5860
System.err.println("Failed to get supported file formats");
5961
e.printStackTrace();
60-
6162
}
6263

6364
}
6465
}
6566
```
6667

6768
## Licensing
69+
6870
All GroupDocs.Conversion Cloud SDKs are licensed under [MIT License](LICENSE).
6971

70-
[Home](https://www.groupdocs.cloud/) | [Docs](https://docs.groupdocs.cloud/conversion/) | [Demos](https://products.groupdocs.app/conversion/family) | [API Reference](https://apireference.groupdocs.cloud/conversion/) | [Source Code](https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android) | [Blog](https://blog.groupdocs.cloud/category/conversion/) | [Free Support](https://forum.groupdocs.cloud/c/conversion) | [Free Trial](https://purchase.groupdocs.cloud/trial)
72+
## Resources
73+
74+
+[**Website**](https://www.groupdocs.cloud)
75+
+[**Product Home**](https://products.groupdocs.cloud/conversion)
76+
+[**Documentation**](https://docs.groupdocs.cloud/conversion)
77+
+[**Free Support Forum**](https://forum.groupdocs.cloud/c/conversion)
78+
+[**Blog**](https://blog.groupdocs.cloud/category/conversion)
79+
80+
## Contact Us
81+
82+
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: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.groupdocs</groupId>
5-
<artifactId>groupdocs-conversion-cloud</artifactId>
5+
<artifactId>groupdocs-conversion-cloud-android</artifactId>
66
<packaging>jar</packaging>
7-
<name>groupdocs-conversion-cloud</name>
8-
<version>20.3</version>
9-
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java</url>
7+
<name>groupdocs-conversion-cloud-android</name>
8+
<version>20.11</version>
9+
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android</url>
1010
<description>Java library for communicating with the GroupDocs.Conversion Cloud API</description>
1111
<scm>
12-
<connection>scm:git:git@github.com:groupdocs-conversion-cloud/groupdocs-conversion-cloud-java.git</connection>
13-
<developerConnection>scm:git:git@github.com:groupdocs-conversion-cloud/groupdocs-conversion-cloud-java.git</developerConnection>
14-
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java</url>
12+
<connection>scm:git:git@github.com:groupdocs-conversion-cloud/groupdocs-conversion-cloud-android.git</connection>
13+
<developerConnection>scm:git:git@github.com:groupdocs-conversion-cloud/groupdocs-conversion-cloud-android.git</developerConnection>
14+
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android</url>
1515
</scm>
1616

1717
<licenses>
1818
<license>
1919
<name>MIT License</name>
20-
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java/blob/master/LICENSE</url>
20+
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android/blob/master/LICENSE</url>
2121
<distribution>repo</distribution>
2222
</license>
2323
</licenses>
@@ -33,9 +33,9 @@
3333

3434
<repositories>
3535
<repository>
36-
<id>maven.aspose.cloud</id>
37-
<name>maven.aspose.cloud</name>
38-
<url>https://repository.aspose.cloud/repo/</url>
36+
<id>maven.groupdocs.cloud</id>
37+
<name>maven.groupdocs.cloud</name>
38+
<url>https://repository.groupdocs.cloud/repo/</url>
3939
</repository>
4040
</repositories>
4141

@@ -94,7 +94,7 @@
9494
<plugin>
9595
<groupId>org.apache.maven.plugins</groupId>
9696
<artifactId>maven-javadoc-plugin</artifactId>
97-
<version>2.10.4</version>
97+
<version>3.0.1</version>
9898
<executions>
9999
<execution>
100100
<id>attach-javadocs</id>
@@ -137,7 +137,7 @@
137137
dir="${project.basedir}"
138138
executable="powershell"
139139
failonerror="true">
140-
<arg line="-Command &quot;(Get-Content simplified-pom.template) | ForEach-Object { $_ -replace &quot;{{VERSION}}&quot;, &quot;${project.version}&quot; } | Set-Content simplified-pom.xml&quot;" />
140+
<arg line="-Command &quot;(Get-Content simplified-pom.template) | ForEach-Object { $_ -replace &quot;{{VERSION}}&quot;, {&quot;${project.version}&quot;} } | Set-Content simplified-pom.xml&quot;" />
141141
</exec>
142142
</tasks>
143143
</configuration>
@@ -183,8 +183,8 @@
183183
<configuration>
184184
<repositoryId>Groupdocs-Cloud-QA</repositoryId>
185185
<url>https://repository-qa.groupdocs.cloud/repo</url>
186-
<file>target/groupdocs-conversion-cloud-${project.version}.jar</file>
187-
<javadoc>target/groupdocs-conversion-cloud-${project.version}-javadoc.jar</javadoc>
186+
<file>target/groupdocs-conversion-cloud-android-${project.version}.jar</file>
187+
<javadoc>target/groupdocs-conversion-cloud-android-${project.version}-javadoc.jar</javadoc>
188188
<pomFile>simplified-pom.xml</pomFile>
189189
<packaging>${project.packaging}</packaging>
190190
</configuration>
@@ -218,7 +218,7 @@
218218
dir="${project.basedir}"
219219
executable="powershell"
220220
failonerror="true">
221-
<arg line="-Command &quot;(Get-Content simplified-pom.template) | ForEach-Object { $_ -replace &quot;{{VERSION}}&quot;, &quot;${project.version}&quot; } | Set-Content simplified-pom.xml&quot;" />
221+
<arg line="-Command &quot;(Get-Content simplified-pom.template) | ForEach-Object { $_ -replace &quot;{{VERSION}}&quot;, {&quot;${project.version}&quot;} } | Set-Content simplified-pom.xml&quot;" />
222222
</exec>
223223
</tasks>
224224
</configuration>
@@ -264,8 +264,8 @@
264264
<configuration>
265265
<repositoryId>Groupdocs-Cloud-PROD</repositoryId>
266266
<url>https://repository.groupdocs.cloud/repo</url>
267-
<file>target/groupdocs-conversion-cloud-${project.version}.jar</file>
268-
<javadoc>target/groupdocs-conversion-cloud-${project.version}-javadoc.jar</javadoc>
267+
<file>target/groupdocs-conversion-cloud-android-${project.version}.jar</file>
268+
<javadoc>target/groupdocs-conversion-cloud-android-${project.version}-javadoc.jar</javadoc>
269269
<pomFile>simplified-pom.xml</pomFile>
270270
<packaging>${project.packaging}</packaging>
271271
</configuration>
@@ -323,6 +323,12 @@
323323
<version>${junit-version}</version>
324324
<scope>test</scope>
325325
</dependency>
326+
<dependency>
327+
<groupId>pl.pragmatists</groupId>
328+
<artifactId>JUnitParams</artifactId>
329+
<version>1.0.5</version>
330+
<scope>test</scope>
331+
</dependency>
326332
</dependencies>
327333
<properties>
328334
<java.version>1.7</java.version>
@@ -334,7 +340,7 @@
334340
<gson-version>2.8.1</gson-version>
335341
<threetenbp-version>1.3.5</threetenbp-version>
336342
<maven-plugin-version>1.0.0</maven-plugin-version>
337-
<junit-version>4.12</junit-version>
343+
<junit-version>4.13.1</junit-version>
338344
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
339345
</properties>
340346
</project>

simplified-pom.template

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>com.groupdocs</groupId>
7-
<artifactId>groupdocs-conversion-cloud</artifactId>
7+
<artifactId>groupdocs-conversion-cloud-android</artifactId>
88
<version>{VERSION}</version>
99
<packaging>jar</packaging>
1010

11-
<name>groupdocs-conversion-cloud</name>
11+
<name>groupdocs-conversion-cloud-android</name>
1212
<description>Java library for communicating with the GroupDocs.Conversion Cloud API</description>
13-
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java</url>
13+
<url>https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-android</url>
1414

1515
<licenses>
1616
<license>
@@ -30,16 +30,16 @@
3030

3131
<repositories>
3232
<repository>
33-
<id>maven.aspose.cloud</id>
34-
<name>maven.aspose.cloud</name>
35-
<url>https://repository.aspose.cloud/repo/</url>
33+
<id>maven.groupdocs.cloud</id>
34+
<name>maven.groupdocs.cloud</name>
35+
<url>https://repository.groupdocs.cloud/repo/</url>
3636
</repository>
3737
</repositories>
3838

3939
<dependencies>
4040
<dependency>
4141
<groupId>io.swagger</groupId>
42-
<artifactId>swagger-annotations</artifactId>
42+
<artifactId>swagger-conversions</artifactId>
4343
<version>${swagger-core-version}</version>
4444
</dependency>
4545
<dependency>

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());

0 commit comments

Comments
 (0)