Griefed / hastebin.java

A simple Hastebin API wrapper for Java. Pages: https://griefed.pages.griefed.de/hastebin-java/ or https://griefed.github.io/hastebin.java/.

Home Page:https://griefed.github.io/hastebin.java/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hastebin.java

[[TOC]]

A simple Hastebin API wrapper for Java. Forked from kaimu-kun/hastebin.java and edited to use HasteBin fork zneix/haste-server and to create a post from a passed file, instead of a passed string.

Requires Apache commons-io in order to read the passed file to a string and Apache log4j2( SLF4j LOG4J 12 Binding and Apache Log4j SLF4J Binding) for logging. Logging can be replaced by regular ex.printStackTrace(); if you do not want to add any log4j dependencies to your project.

Example:

Hastebin hastebin = new Hastebin();
String hasteBinPost = null;

// Define the file which you want to post to HasteBin
File file = new File("path/to/your/file.txt");

// Create the HasteBin post and store the returned string.
hasteBinPost = hastebin.createHasteBinFromFile(file);

// Print the String containing our URL.
System.out.println(hasteBinPost);

About

A simple Hastebin API wrapper for Java. Pages: https://griefed.pages.griefed.de/hastebin-java/ or https://griefed.github.io/hastebin.java/.

https://griefed.github.io/hastebin.java/

License:MIT License


Languages

Language:Java 100.0%