This repository contains GroupDocs.Watermark Cloud SDK for Java source code. This SDK allows you to work with GroupDocs.Watermark Cloud REST APIs in your Java applications.
Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, execute:
mvn install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deploy
Refer to the official documentation for more information.
Add following repository and dependency to your project's POM
<repository>
<id>groupdocs-artifact-repository</id>
<name>GroupDocs Artifact Repository</name>
<url>https://repository.groupdocs.cloud/repo</url>
</repository>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-watermark-cloud</artifactId>
<version>22.3</version>
<scope>compile</scope>
</dependency>
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/groupdocs-watermark-cloud-22.3.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.groupdocs.cloud.watermark.client.*;
import com.groupdocs.cloud.watermark.model.*;
import com.groupdocs.cloud.watermark.api.WatermarkApi;
import java.util.*;
public class ApiExample {
public static void main(String[] args) {
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
String appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
String appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
Configuration configuration = new Configuration(appSid, appKey);
WatermarkApi watermarkApi = new WatermarkApi(configuration);
try {
FormatsResult response = watermarkApi.getSupportedFileFormats();
for (Format format : response.getFormats()) {
System.out.println(format.getFileFormat());
}
} catch (ApiException e) {
System.err.println("Failed to get supported file formats");
e.printStackTrace();
}
}
}
All GroupDocs.Watermark Cloud SDKs are licensed under MIT License.
Your feedback is very important to us. Please feel free to contact us using our Support Forums.