Skip to content

Commit f05abd5

Browse files
authored
Merge pull request #42 from ConvertAPI/develop
Merge develop into master
2 parents 6500a84 + 71a573e commit f05abd5

18 files changed

+60
-210
lines changed

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ And many others files manipulations.
88
In just few minutes you can integrate it into your application and use it easily.
99

1010
The ConvertAPI-Java library makes it easier to use the Convert API from your Java 8 projects without having to build your own API calls.
11-
You can get your free API secret at https://www.convertapi.com/a
11+
You can get your free API credentials at https://www.convertapi.com/a
1212

1313
## Installation
1414

@@ -19,21 +19,18 @@ Add the following dependency to your pom.xml:
1919
<dependency>
2020
<groupId>com.convertapi.client</groupId>
2121
<artifactId>convertapi</artifactId>
22-
<version>2.10</version>
22+
<version>2.11</version>
2323
</dependency>
2424
```
2525

2626
## Usage
2727

2828
### Configuration
2929

30-
You can get your secret at https://www.convertapi.com/a
30+
You can get your credentials at https://www.convertapi.com/a
3131

3232
```java
33-
Config.setDefaultSecret("your-api-secret");
34-
// or token authentication
35-
Config.setDefaultToken("your-token");
36-
Config.setDefaultApiKey("your-api-key");
33+
Config.setDefaultApiCredentials("your-api-secret");
3734
```
3835

3936
### File conversion
@@ -98,7 +95,7 @@ int conversionsConsumed = user.ConversionsConsumed;
9895
Create `Config` instance with the alternative domain and provide it in `convert` method. Dedicated to the region [domain list](https://www.convertapi.com/doc/servers-location).
9996

10097
```java
101-
Config config = new Config(secret, "https", "eu-v2.convertapi.com", 0, httpClientBuilder);
98+
Config config = new Config(credentials, "https", "eu-v2.convertapi.com", 0, httpClientBuilder);
10299
```
103100

104101
### More examples
@@ -114,13 +111,13 @@ import com.convertapi.ConvertApi;
114111

115112
public class SimpleConversion {
116113
public static void main(String[] args) {
117-
ConvertApi.convert("source.docx", "result.pdf", "your-api-secret");
114+
ConvertApi.convert("source.docx", "result.pdf", "your-api-credentials");
118115
}
119116
}
120117
```
121118

122119
This is the bare-minimum to convert a file using the ConvertAPI client, but you can do a great deal more with the ConvertAPI Java library.
123-
Take special note that you should replace `your-api-secret` with the secret you obtained in item two of the pre-requisites.
120+
Take special note that you should replace `your-api-credentials` with the secret you obtained in item two of the pre-requisites.
124121

125122
### Issues &amp; Comments
126123
Please leave all comments, bugs, requests, and issues on the Issues page. We'll respond to your request ASAP!

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>com.convertapi.client</groupId>
1717
<artifactId>convertapi</artifactId>
18-
<version>2.10</version>
18+
<version>2.11</version>
1919
</dependency>
2020
</dependencies>
2121

examples/src/main/java/com/convertapi/examples/Advanced.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class Advanced {
2222

2323
public static void main(String[] args) throws ExecutionException, InterruptedException {
24-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
24+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2525

2626
// Advanced HTTP client setup
2727
Config.setDefaultHttpBuilder(builder -> {

examples/src/main/java/com/convertapi/examples/AlternativeConverter.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

examples/src/main/java/com/convertapi/examples/ConversionChaining.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class ConversionChaining {
2222

2323
public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
24-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
24+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2525

2626
System.out.println("Converting PDF to JPG and compressing result files with ZIP");
2727
CompletableFuture<ConversionResult> jpgResult = ConvertApi.convert("docx", "jpg", new Param("file", Paths.get("files/test.docx")));

examples/src/main/java/com/convertapi/examples/ConvertRemoteFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class ConvertRemoteFile {
2121

2222
public static void main(String[] args) throws ExecutionException, InterruptedException {
23-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
23+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2424

2525
System.out.println("Converting remote PPTX to PDF");
2626
CompletableFuture<ConversionResult> result = ConvertApi.convert("pptx", "pdf",

examples/src/main/java/com/convertapi/examples/ConvertStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
public class ConvertStream {
2323

2424
public static void main(String[] args) throws ExecutionException, InterruptedException, IOException {
25-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
25+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2626

2727
// Creating file data stream
2828
InputStream stream = Files.newInputStream(new File("src/main/resources/test.docx").toPath());

examples/src/main/java/com/convertapi/examples/ConvertWebToPdf.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class ConvertWebToPdf {
2121

2222
public static void main(String[] args) throws ExecutionException, InterruptedException {
23-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
23+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2424

2525
System.out.println("Converting WEB to PDF");
2626
CompletableFuture<ConversionResult> result = ConvertApi.convert("web", "pdf",

examples/src/main/java/com/convertapi/examples/ConvertWordToPdfAndPng.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class ConvertWordToPdfAndPng {
2424

2525
public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
26-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
26+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2727
Path tempDir = Paths.get(System.getProperty("java.io.tmpdir"));
2828

2929
System.out.println("Converting DOCX to PDF and JPG in parallel");

examples/src/main/java/com/convertapi/examples/CreatePdfThumbnail.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class CreatePdfThumbnail {
2222

2323
public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
24-
Config.setDefaultSecret(getenv("CONVERTAPI_SECRET")); //Get your secret at https://www.convertapi.com/a
24+
Config.setDefaultApiCredentials(getenv("CONVERTAPI_CREDENTIALS")); //Get your api credentials at https://www.convertapi.com/a
2525
Path tempDir = Paths.get(System.getProperty("java.io.tmpdir"));
2626

2727
System.out.println("Creating PDF thumbnail");

0 commit comments

Comments
 (0)