在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:nabeelmukhtar/github-java-sdk开源软件地址:https://github.com/nabeelmukhtar/github-java-sdk开源编程语言:Java 100.0%开源软件介绍:GitHub Java SDKDescriptionThis project provides a Java wrapper for the GitHub API v.2.0. LicenseThis project is open source with Apache License, Version 2.0. RequirementsThis project has only one dependency on Gson which can be downloaded here. The library is supported on AppEngine and Android platforms as well. Key FeaturesThe 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.
UsageMost of the methods of the API can be invoked without using any authentication. However some need the user to be authenticated. TypicalThe 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); AuthenticatedAuthenticated 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 InformationFor more information see the following wiki pages.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论