Question

I'm working on a program where I'm coding in Java, and require to use certain Bitbucket features using Java code. However, BitBucket doesn't provide any nicely-packaged-use-out-of-the-box libraries for Java developers, which means I'll have to use their REST API.

How would I go about this?

Would I make use of java.net.URL and/or java.net.URLConnection? Or maybe use Jersey/JAX-RS? Or something else?

To sum up:
Which would be the simplest, most correct way of using BitBucket's REST APIs in Java?
And using the suggested method, how would I, say, create an issue on the issue tracker of the tutorials repository?

Thanks :)

PS: This is not homework :). I have not put any code here because I don't have much of an idea about web development, let alone doing web-development-related-tasks via Java :(.

Was it helpful?

Solution

I've interacted with REST APIs just fine using URLConnection.

You should look to confirm there are no Java libraries available (even if no official ones there might be unofficial 3rd party ones).

OTHER TIPS

I'm working on such a library. It will take some more time to be usable for real works but I hope you would be interested. I don't introduce the project location here because it can be the cause of deletion of this answer. Please search for Bitbucket API Client for Java on a search engine for the current status.

It will provide a language binding to the Bitbucket REST API by Java classes wrapping details about REST and HTTP. You will be able to access Bitbucket without writing most of REST and HTTP handling code. In addition, it supports OAuth authorization and you don't have to ask user name and password yourself. By using OAuth, users can know how your application uses your account when they first authorize your application's access.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top