-
Notifications
You must be signed in to change notification settings - Fork 2
Example of API
The-Shadow edited this page Oct 2, 2011
·
3 revisions
Example of using the API. The following example Pastes a new TEXT paste and then prints out the resulting URL.
``import com.darkprograms.pastehtml.exception.NoTypeDefined; import com.darkprograms.pastehtml.objects.PasteObject; import com.darkprograms.pastehtml.types.PasteText;
public class PasteHTMLTest {
public static void main(String args[]){
PasteObject object = new PasteObject(new PasteText());
try{
System.out.println(object.pasteData("This is a test from the Java API for PasteHTML"));
}catch (NoTypeDefined ex){
ex.printStackTrace();
}
}
}``