Programming and writing about it.

echo $RANDOM

Belenix Documentation linked my blog post

Updated: Belenix 0.7, Ubuntu 8.04 and Sun xVM Virtual Box 1.6

My blog post Installing Belenix 0.7 with VirtualBox on Ubuntu 7.04 has been linked from the Belenix official documentation, Yay!

Java client for using NetBeans is a bookmarking service where you can save, share your favorite/useful URL’s.

It has a REST API: Using this API you can design clients (web/desktop) to use the service. NetBeans 6.1 comes bundled with the APIs for popular web-services, which includes

In this post, I shall code a simple Java console client for to fetch your recent posts. (For details, please refer‘ at

You may download the complete NetBeans 6.1 Beta project here

Needless to say, you will need a account to follow this post.

  • Create a new project

  • Insert a method ‘getPosts()’ in the ‘Main’ class generated:

  • /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.

    package deliciousclient;

    * @author amit
    public class Main {

    * @param args the command line arguments
    public static void main(String[] args) {


    private static void getPosts() {



  • Expand the Web Services node and hence expand the ‘’ node to finally descend to the ‘delicious.posts_get’ API call.

  • Once you are there, click on it and drag it onto the body of the ‘getPosts()’ method. You will be asked to configure the API parameters, which you can either set to your own values or leave the default values

  • The method will now look like this:

  • private static void getPosts() {

    try {
    String tag = "xml";
    String dt = null;
    String url = "";

    String result = DeliciousService.getDeliciousPostsGetResource(tag, dt, url);
    System.out.println("The SaasService returned: "+result);
    } catch ( ex) {
    //java.util.logging.Logger.getLogger(this.getClass().getName()).log(java.util.logging.Level.SEVERE, null, ex);

  • You will observe that some new classes have been added to your project. They are classes which take care of the REST API calls to the service

  • But before running your project and hence using the service, you will have to provide your account details in the ‘’ file in the ‘org.netbeans.saas.delicious’ package. For eg.

  • username=amitkumarsaha

  • Run the project, you should get back the the XML representation of the result.

Thus, we have seen how easy it is to design a client using NetBeans 6.1. Similarly the other APIs can also be explored!

API Documentation

  • You can view the API documentation by a ‘Right-Click’ on the service name,and you will be taken to the relevant API documentation (you will need to be online for this)

Happy NetBeaning!