Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.08 KB

README.md

File metadata and controls

48 lines (39 loc) · 1.08 KB

JPastee

Java Wrapper for the https://paste.ee/ API

Installation

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compile 'fr.minuskube:jpastee:1.0.2'
}

Maven

<dependency>
  <groupId>fr.minuskube</groupId>
  <artifactId>jpastee</artifactId>
  <version>1.0.2</version>
</dependency>

Manually

You can download the latest version on the Releases page on Github.

Example

JPastee pastee = new JPastee("YOUR_API_KEY");

Paste paste = Paste.builder()
        .description("My super paste!")
        .addSection(Section.builder()
                .name("An awesome section.")
                .contents("This is a test made using the JPastee API.")
                .syntax(pastee.getSyntaxFromName("java").get())
                .build())
        .build();
        
SubmitResponse resp = pastee.submit(paste);

if(resp.isSuccess())
    System.out.println("The paste was successfully submitted!");
else
    System.out.println("The paste could not be submitted... " + resp.getErrorString());