You can install the wrapper with the following dependency managers.
The repo can be downloaded from jcenter.
The docs are available here
The current latest version is:
repositories {
mavenCentral()
maven {
name 'duncte123-jfrog'
url 'https://duncte123.jfrog.io/artifactory/maven'
}
}
dependencies {
implementation group: 'org.menudocs', name: 'paste-client-java', version: '[VERSION]'
}
<repository>
<id>jfrog-duncte123</id>
<name>jfrog-duncte123</name>
<url>https://duncte123.jfrog.io/artifactory/maven</url>
</repository>
<dependency>
<groupId>org.menudocs</groupId>
<artifactId>paste-client-java</artifactId>
<version>[VERSION]</version>
</dependency>
import org.menudocs.paste.PasteClient;
import org.menudocs.paste.PasteClientBuilder;
import org.menudocs.paste.PasteHost;
PasteClient client = new PasteClientBuilder()
.setUserAgent("Example paste client")
.setDefaultExpiry("10m")
.setPasteHost(PasteHost.MENUDOCS) // Optional
.build();
// Sync operation
String pasteID = client.createPaste("html", "<h1>testing</h1>").execute();
// Async operation
client.createPaste("html", "<h1>testing</h1>").async((pasteID) -> {
// Use pasteID here
});
String pasteUrl = client.getPasteUrl(pasteID);
// Sync operation
Paste paste = client.getPaste(pasteID).execute();
System.out.println(paste.getPasteUrl());
System.out.println(paste.getBody());
// Async operation
client.getPaste(pasteID).async((paste) -> {
System.out.println(paste.getPasteUrl());
System.out.println(paste.getBody());
});