From 6fd7c842763820a6f3c12e22c6fce75b7df5b9b5 Mon Sep 17 00:00:00 2001 From: Tim Ekl Date: Wed, 30 Nov 2011 11:44:18 -0500 Subject: [PATCH] Fix Javadoc on PasteService interface --- .../utils/webpaste/PasteService.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteService.java index 82086e3a..f830658c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteService.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteService.java @@ -2,12 +2,24 @@ package com.onarandombox.MultiverseCore.utils.webpaste; import java.net.URL; +/** + * An interface to a web-based text-pasting service. Classes implementing this + * interface should implement its methods to send data to an online text-sharing + * service, such as pastebin.com. Conventionally, a paste is accomplished by (given + * some PasteService instance ps): + * + * {@code ps.postData(ps.encodeData(someString), ps.getPostURL());} + * + * Services that provide a distinction between "public" and "private" pastes + * should implement a custom constructor that specifies which kind the PasteService + * instance is submitting; an example of this is the PastiePasteService class. + */ public interface PasteService { + /** * Encode the given String data into a format suitable for transmission in an HTTP request. * * @param data The raw data to encode. - * @param isPrivate Whether the paste is desired to be private. * @return A URL-encoded string. */ public String encodeData(String data); @@ -15,7 +27,6 @@ public interface PasteService { /** * Get the URL to which this paste service sends new pastes. * - * @param isPrivate Whether the paste is desired to be private. * @return The URL that will be accessed to complete the paste. */ public URL getPostURL(); @@ -26,8 +37,8 @@ public interface PasteService { * @param encodedData A URL-encoded String containing the full request to post to * the given URL. Can be the result of calling #encodeData(). * @param url The URL to which to paste. Can be the result of calling #getPostURL(). - * @param isPrivate Whether the paste is desired to be private. * @return The URL at which the new paste is visible. */ public String postData(String encodedData, URL url) throws PasteFailedException; + }