Class PasteService
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.webpaste.PasteService
-
public abstract class PasteService extends java.lang.Object
An interface to a web-based text-pasting service. Classes extending this should implement its methods to send data to an online text-sharing service, such as pastebin.com. Given some PasteService instance ps, a paste is accomplished by:ps.postData(someString);
Services that provide a distinction between "public" and "private" pastes should implement a constructor that specifies which kind the PasteService instance is submitting; an example of this is the PastebinPasteService class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.String
postData(java.lang.String data)
Post data to the Web.abstract java.lang.String
postData(java.util.Map<java.lang.String,java.lang.String> data)
Post data to the Web.abstract boolean
supportsMultiFile()
Does this service support uploading multiple files.
-
-
-
Method Detail
-
postData
public abstract java.lang.String postData(java.lang.String data) throws PasteFailedException
Post data to the Web.- Parameters:
data
- A String to post to the web.- Returns:
- The URL at which the new paste is visible.
- Throws:
PasteFailedException
- When pasting/posting the data failed.
-
postData
public abstract java.lang.String postData(java.util.Map<java.lang.String,java.lang.String> data) throws PasteFailedException
Post data to the Web.- Parameters:
data
- A Map to post to the web.- Returns:
- The URL at which the new paste is visible.
- Throws:
PasteFailedException
- When pasting/posting the data failed.
-
supportsMultiFile
public abstract boolean supportsMultiFile()
Does this service support uploading multiple files. Newer services like GitHub's Gist support multi-file pastes, which allows us to upload configs in addition to the standard logs.- Returns:
- True if this service supports multiple file upload.
-
-