简体   繁体   English

在Java中使用BitBucket REST API

[英]Using BitBucket REST API with Java

I'm working on a program where I'm coding in Java, and require to use certain Bitbucket features using Java code. 我正在使用Java编写程序,并且需要使用Java代码使用某些Bitbucket功能。 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. 但是,BitBucket没有为Java开发人员提供任何打包好的现成可用的库,这意味着我将不得不使用他们的REST API。

How would I go about this? 我将如何处理?

Would I make use of java.net.URL and/or java.net.URLConnection ? 会使用java.net.URL和/或java.net.URLConnection吗? Or maybe use Jersey/JAX-RS ? 或者也许使用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 ? 在Java中使用BitBucket的REST API的最简单,最正确的方法是什么?
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 :). PS:这不是功课:)。 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 :(. 我没有在这里放置任何代码,因为我对Web开发没有太多了解,更不用说通过Java :(。做与Web开发相关的任务了

I've interacted with REST APIs just fine using URLConnection. 我已经使用URLConnection与REST API进行了交互。

You should look to confirm there are no Java libraries available (even if no official ones there might be unofficial 3rd party ones). 您应该确认没有可用的Java库(即使没有正式的Java库,也可能有非官方的第三方库)。

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. 请在搜索引擎上搜索Java的Bitbucket API客户端以获取当前状态。

It will provide a language binding to the Bitbucket REST API by Java classes wrapping details about REST and HTTP. 它将通过Java类提供有关绑定到REST和HTTP的详细信息的语言绑定到Bitbucket REST API。 You will be able to access Bitbucket without writing most of REST and HTTP handling code. 您无需编写大多数REST和HTTP处理代码即可访问Bitbucket。 In addition, it supports OAuth authorization and you don't have to ask user name and password yourself. 此外,它支持OAuth授权,您无需亲自询问用户名和密码。 By using OAuth, users can know how your application uses your account when they first authorize your application's access. 通过使用OAuth,用户在首次授权您的应用程序访问权限时就可以知道您的应用程序如何使用您的帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM