Package dev.cwhead.GravesX.util
Class PastebinUtil
java.lang.Object
dev.cwhead.GravesX.util.PastebinUtil
Minimal Pastebin API client for posting text dumps.
Returns the paste URL on success, or
null on failure.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappend(StringBuilder sb, String key, String val) private static intmapPrivacyToInt(String privacy) static StringPost text content to Pastebin.private static String
-
Field Details
-
API_URL
- See Also:
-
-
Constructor Details
-
PastebinUtil
private PastebinUtil()
-
-
Method Details
-
post
public static String post(String devKey, String userKey, String title, String content, String privacy, String expire) Post text content to Pastebin.- Parameters:
devKey- Pastebin API dev key (required)userKey- Pastebin user key (optional; required for PRIVATE pastes)title- Paste titlecontent- Paste body (text)privacy- "PUBLIC" | "UNLISTED" | "PRIVATE" (case-insensitive)expire- "N" | "10M" | "1H" | "1D" | "1W" | "2W" | "1M" | "6M" | "1Y"- Returns:
- The paste URL on success;
nullon error.
-
mapPrivacyToInt
-
append
-
safeUpper
-