an API for cloud-client.sh functionality

I have been regularly using the cloud-client.sh script. I would like to get the same functionality through direct Java calls. Is there an API available that would do this? I am especially interested in concrete examples. Of course, I could write my own Java wrapper to the client via something like, Java's ProcessBuilder or the Runtime exec(), but there ought to be a direct way.