Coder Social home page Coder Social logo

github-java-sdk's Introduction

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 servive using a factory and invoking the methods of that service. GitHubServiceFactory factory = GitHubServiceFactory.newInstance(); RepositoryService service = factory.createRepositoryService(); List 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.

github-java-sdk's People

Contributors

nabeelmukhtar avatar aslakknutsen avatar

Stargazers

Jason Rush avatar

Watchers

Jason Rush avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.