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/
- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
fix(deps): update dependency org.apache.logging.log4j:log4j-slf4j-impl to v2.22.0 See merge request Griefed/hastebin-java!117 |
||
| .github/workflows | ||
| .gitlab/issue_templates | ||
| .idea | ||
| build | ||
| gradle/wrapper | ||
| src | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| build.gradle | ||
| gradlew | ||
| gradlew.bat | ||
| LICENSE.txt | ||
| README.md | ||
| renovate.json | ||
| settings.gradle | ||
| test.txt | ||
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);