Package dev.cwhead.GravesX.util
Class ToptalUtil
java.lang.Object
dev.cwhead.GravesX.util.ToptalUtil
Client for Toptal's Hastebin service.
API docs: https://www.toptal.com/developers/hastebin/documentation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringextractKey(String json) static StringPost plain text to Toptal Hastebin.private static voidsetup(HttpURLConnection conn)
-
Field Details
-
API_URL
- See Also:
-
VIEW_BASE
- See Also:
-
MAX_LEN
private static final int MAX_LEN- See Also:
-
CONNECT_TIMEOUT_MS
private static final int CONNECT_TIMEOUT_MS- See Also:
-
READ_TIMEOUT_MS
private static final int READ_TIMEOUT_MS- See Also:
-
USER_AGENT
- See Also:
-
-
Constructor Details
-
ToptalUtil
private ToptalUtil()
-
-
Method Details
-
post
Post plain text to Toptal Hastebin.- Parameters:
content- Text to upload (400k chars or 1MB)bearerToken- Required token for Authorization header ("Bearer token");- Returns:
- The standard view URL (https://hastebin.com/{key}), or null on failure.
-
setup
- Throws:
ProtocolException
-
extractKey
-