Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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(PasteType.TYPE_TEXT);
        try{
        System.out.println(object.pasteData("This is a test from the Java API for PasteHTML"));
        }catch (NoTypeDefined ex){
            ex.printStackTrace();
        }
    }

}

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.