Skip to content

Commit 00bfcd5

Browse files
Merge pull request #3 from kaferi/master
Updated to 18.7
2 parents 9b8f46b + 0bf0ad6 commit 00bfcd5

File tree

121 files changed

+15070
-13216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+15070
-13216
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.mht -crlf -diff

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018 Aspose.Pdf for Cloud
2+
# Copyright (c) 2018 Aspose.PDF Cloud
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to deal
55
# in the Software without restriction, including without limitation the rights

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Add this dependency to your project's POM:
3434
<dependency>
3535
<groupId>com.aspose</groupId>
3636
<artifactId>aspose-cloud-pdf</artifactId>
37-
<version>18.6.0</version>
37+
<version>18.7.0</version>
3838
<scope>compile</scope>
3939
</dependency>
4040
```
@@ -44,7 +44,7 @@ Add this dependency to your project's POM:
4444
Add this dependency to your project's build file:
4545

4646
```groovy
47-
compile "com.aspose:aspose-cloud-pdf:18.6.0"
47+
compile "com.aspose:aspose-cloud-pdf:18.7.0"
4848
```
4949

5050
### Others
@@ -55,7 +55,7 @@ At first generate the JAR by executing:
5555

5656
Then manually install the following JARs:
5757

58-
* target/aspose-cloud-pdf-18.6.0.jar
58+
* target/aspose-cloud-pdf-18.7.0.jar
5959
* target/lib/*.jar
6060

6161
## Getting Started

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2018 Aspose.Pdf for Cloud
2+
* Copyright (c) 2018 Aspose.PDF Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights
@@ -20,7 +20,7 @@ apply plugin: 'idea'
2020
apply plugin: 'eclipse'
2121

2222
group = 'com.aspose'
23-
version = '18.6.0'
23+
version = '18.7.0'
2424

2525
buildscript {
2626
repositories {
@@ -71,8 +71,8 @@ dependencies {
7171
publish {
7272
groupId = 'com.aspose'
7373
artifactId = 'aspose-cloud-pdf'
74-
publishVersion = '18.6.0'
75-
desc = 'Aspose.PDF for Cloud is a REST API for creating and editing PDF files. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.Pdf for Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.Pdf for Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.'
74+
publishVersion = '18.7.0'
75+
desc = 'Aspose.PDF Cloud is a REST API for creating and editing PDF files. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.PDF Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.PDF Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.'
7676
licences = ['MIT']
7777
website = 'https://products.aspose.cloud/pdf/cloud'
7878
repository = 'https://github.com/aspose-pdf-cloud/aspose-pdf-cloud.git'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018 Aspose.Pdf for Cloud
2+
# Copyright (c) 2018 Aspose.PDF Cloud
33
# Permission is hereby granted, free of charge, to any person obtaining a copy
44
# of this software and associated documentation files (the "Software"), to deal
55
# in the Software without restriction, including without limitation the rights

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
##
55
## Gradle start up script for UN*X
66
##
7-
## Copyright (c) 2018 Aspose.Pdf for Cloud
7+
## Copyright (c) 2018 Aspose.PDF Cloud
88
## Permission is hereby granted, free of charge, to any person obtaining a copy
99
## of this software and associated documentation files (the "Software"), to deal
1010
## in the Software without restriction, including without limitation the rights

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2018 Aspose.Pdf for Cloud
2+
* Copyright (c) 2018 Aspose.PDF Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights

src/main/java/com/aspose/asposecloudpdf/ApiCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2018 Aspose.Pdf for Cloud
3+
* Copyright (c) 2018 Aspose.PDF Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights

src/main/java/com/aspose/asposecloudpdf/ApiClient.java

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2018 Aspose.Pdf for Cloud
3+
* Copyright (c) 2018 Aspose.PDF Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights
@@ -1010,48 +1010,60 @@ public String guessContentTypeFromFile(File file) {
10101010
/**
10111011
* Request OAuth token
10121012
*/
1013-
private void requestToken() throws IOException
1013+
private void requestToken() throws ApiException
10141014
{
1015-
RequestBody requestBody = new FormEncodingBuilder()
1016-
.addEncoded("grant_type", "client_credentials")
1017-
.addEncoded("client_id", getAppSid())
1018-
.addEncoded("client_secret", getAppKey())
1019-
.build();
1020-
1021-
String url = basePath.replace("/v1.1", "") + "/oauth2/token";
1022-
Request request = new Request.Builder()
1023-
.url(url)
1024-
.post(requestBody)
1025-
.addHeader("Content-Type", " application/x-www-form-urlencoded")
1026-
.build();
1027-
1028-
Response response = httpClient.newCall(request).execute();
1029-
GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class);
1030-
setAccessToken(result.access_token);
1031-
setRefreshToken(result.refresh_token);
1015+
try {
1016+
RequestBody requestBody = new FormEncodingBuilder()
1017+
.addEncoded("grant_type", "client_credentials")
1018+
.addEncoded("client_id", getAppSid())
1019+
.addEncoded("client_secret", getAppKey())
1020+
.build();
1021+
1022+
String url = basePath.replace("/v1.1", "") + "/oauth2/token";
1023+
Request request = new Request.Builder()
1024+
.url(url)
1025+
.post(requestBody)
1026+
.addHeader("Content-Type", " application/x-www-form-urlencoded")
1027+
.build();
1028+
1029+
Response response = httpClient.newCall(request).execute();
1030+
GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class);
1031+
setAccessToken(result.access_token);
1032+
setRefreshToken(result.refresh_token);
1033+
}
1034+
catch (Exception ex)
1035+
{
1036+
throw new ApiException(ex);
1037+
}
10321038
}
10331039

10341040
/**
10351041
* Refresh OAuth token
10361042
*/
1037-
private void refreshToken() throws IOException
1043+
public void refreshToken() throws ApiException
10381044
{
1039-
RequestBody requestBody = new FormEncodingBuilder()
1040-
.addEncoded("grant_type", "refresh_token")
1041-
.addEncoded("refresh_token", this.refreshToken)
1042-
.build();
1043-
1044-
String url = basePath.replace("/v1.1", "") + "/oauth2/token";
1045-
Request request = new Request.Builder()
1046-
.url(url)
1047-
.post(requestBody)
1048-
.addHeader("Content-Type", " application/x-www-form-urlencoded")
1049-
.build();
1050-
1051-
Response response = httpClient.newCall(request).execute();
1052-
GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class);
1053-
setAccessToken(result.access_token);
1054-
setRefreshToken(result.refresh_token);
1045+
try {
1046+
RequestBody requestBody = new FormEncodingBuilder()
1047+
.addEncoded("grant_type", "refresh_token")
1048+
.addEncoded("refresh_token", this.refreshToken)
1049+
.build();
1050+
1051+
String url = basePath.replace("/v1.1", "") + "/oauth2/token";
1052+
Request request = new Request.Builder()
1053+
.url(url)
1054+
.post(requestBody)
1055+
.addHeader("Content-Type", " application/x-www-form-urlencoded")
1056+
.build();
1057+
1058+
Response response = httpClient.newCall(request).execute();
1059+
GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class);
1060+
setAccessToken(result.access_token);
1061+
setRefreshToken(result.refresh_token);
1062+
}
1063+
catch (Exception ex)
1064+
{
1065+
throw new ApiException(ex);
1066+
}
10551067
}
10561068

10571069

@@ -1062,16 +1074,10 @@ private void refreshToken() throws IOException
10621074
*/
10631075
private void addOAuthAuthentication(Map<String, String> headerParams) throws ApiException
10641076
{
1065-
try {
1066-
if (null == accessToken) {
1067-
requestToken();
1068-
}
1069-
headerParams.put("Authorization", "Bearer " + accessToken);
1070-
}
1071-
catch (IOException ex)
1072-
{
1073-
throw new ApiException(ex);
1077+
if (null == accessToken) {
1078+
requestToken();
10741079
}
1080+
headerParams.put("Authorization", "Bearer " + accessToken);
10751081
}
10761082

10771083

src/main/java/com/aspose/asposecloudpdf/ApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2018 Aspose.Pdf for Cloud
3+
* Copyright (c) 2018 Aspose.PDF Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights

0 commit comments

Comments
 (0)