• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

nabeelmukhtar/github-java-sdk: This project aims to provide a Java wrapper for G ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

nabeelmukhtar/github-java-sdk

开源软件地址:

https://github.com/nabeelmukhtar/github-java-sdk

开源编程语言:

Java 100.0%

开源软件介绍:

GitHub Java SDK

Description

This project provides a Java wrapper for the GitHub API v.2.0.

License

This project is open source with Apache License, Version 2.0.

Requirements

This project has only one dependency on Gson which can be downloaded here.

The library is supported on AppEngine and Android platforms as well.

Key Features

The library implements all the methods of GitHub API v.2.0. Additionally it has methods for reading various atom feeds from the GitHub site. It also has a method for downloading the source as a zip archive. The library is divided into various services each implementing a specific portion of the API.

  • UserService: Provides methods of the User API.
  • IssueService: Provides methods of the Issues API.
  • GistService: Provides methods of the Gist API.
  • NetworkService: Provides methods of the Network API.
  • RepositoryService: Provides methods of the Repository API.
  • CommitService: Provides methods of the Commit API.
  • ObjectService: Provides methods of the Object API.
  • OrganizationService: Provides methods of the Organization API.
  • PullRequestService: Provides methods of the Pull Request API.
  • JobService: Provides methods of the Job API.
  • FeedService: Provides methods for reading the Atom/RSS feeds.
  • OAuthService: Provides methods for OAuth 2.0 authentication and authorization.

Usage

Most of the methods of the API can be invoked without using any authentication. However some need the user to be authenticated.

Typical

The typical usage includes the creation of the appropriate service using a factory and invoking the methods of that service.

	GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
	RepositoryService service = factory.createRepositoryService();
	List<Repository> repositories = service.searchRepositories("hadoop");
	for (Repository repository : repositories) {
		printResult(repository);
	}
	Repository repository = service.getRepository("nabeelmukhtar", "github-java-sdk");
	printResult(repository);

Authenticated

Authenticated usage is not very different from typical usage. Before calling any service method that requires authentication, you have to set the credentials on the service instance. Subsequent method calls from the same instance will not need further authentication.

	GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
	RepositoryService service = factory.createRepositoryService();
	service.setAuthentication(new LoginTokenAuthentication("nabeelmukhtar", "xxx-xxx-xxx"));
	service.createRepository("new-repo", "Creating new repository.", "http://www.example.com", Repository.Visibility.PUBLIC);

More Information

For more information see the following wiki pages.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap