<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-comparison-cloud</artifactId>
<version>22.4</version>
</dependency>
copied!  
compile(group: 'com.groupdocs', name: 'groupdocs-comparison-cloud', version: '22.4')
copied!  
<dependency org="com.groupdocs" name="groupdocs-comparison-cloud" rev="22.4">
 <artifact name="groupdocs-comparison-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.groupdocs" % "groupdocs-comparison-cloud" % "22.4"
copied!  

文档比较 Java Cloud REST API

main-banner

Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial

GroupDocs.Comparison Cloud SDK for Java 帮助您构建无需安装任何第 3 方软件即可运行的云文档比较 Java 应用程序。它是 GroupDocs.Comparison Cloud REST APIs 的包装器。


要求

构建 API 客户端库需要:

  1. Java 1.7+
  2. 行家

先决条件

要使用 GroupDocs.Comparison Cloud SDK for Java,您需要在 GroupDocs Cloud 注册一个帐户并在 Cloud Dashboard 查找/创建客户端 ID 和客户端密码。有可用的免费配额。有关详细信息,请参阅GroupDocs Cloud Pricing

从 Maven 安装 GroupDocs.Comparison-Cloud

将 GroupDocs 云存储库添加到您的应用程序 pom.xml

<repository>
    <id>repository.groupdocs.cloud</id>
    <name>repository.groupdocs.cloud</name>
    <url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>

从源安装

要将 API 客户端库安装到本地 Maven 存储库,只需执行:

mvn clean install

要将其部署到远程 Maven 存储库,请配置存储库的设置并执行:

mvn clean deploy

有关更多信息,请参阅 OSSRH Guide

Maven 用户

将此依赖项添加到项目的 POM 中:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-comparison-cloud</artifactId>
    <version>22.4</version>
    <type>pom</type>
</dependency>

### 其他

首先通过执行生成JAR:

mvn clean package

然后手动安装以下 JAR:

-target/groupdocs-comparison-cloud-22.4.jar

  • target/lib/*.jar

开始

请按照 Quick Start 说明进行操作。

用于列出云文档比较更改的示例 Java 代码

// For complete examples and data files, please go to https://github.com/groupdocs-comparison-cloud/groupdocs-comparison-cloud-java-samples
String MyClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
String MyClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud

Configuration configuration = new Configuration(MyClientId, MyClientSecret);

CompareApi apiInstance = new CompareApi(configuration);

FileInfo sourceFileInfo = new FileInfo();
sourceFileInfo.setFilePath("source_files/word/source.docx");
FileInfo targetFileInfo = new FileInfo();
targetFileInfo.setFilePath("target_files/word/target.docx");

ComparisonOptions options = new ComparisonOptions();
options.setSourceFile(sourceFileInfo);
options.addTargetFilesItem(targetFileInfo);

PostChangesRequest request = new PostChangesRequest(options);
List<ChangeInfo> changes = apiInstance.postChanges(request);

授权与认证

Authentication schemes API定义如下:

###智威汤逊

Product Page | Docs | Live Demos | Swagger UI | Code Samples | Blog | Free Support | Free Trial

VersionRelease Date
22.42022年4月14日
19.52022年1月25日
20.122022年1月25日
18.92022年1月25日
21.72021年7月16日
21.32021年3月11日
20.52020年5月21日
18.42018年9月25日