forked from hub4j/github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
247 lines (160 loc) · 6.68 KB
/
index.html
File metadata and controls
247 lines (160 loc) · 6.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>GitHub API for Java - </title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/1024px.css");
@import url("./css/site.css");
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="wrap2"><div id="wrap">
<div id="header">
<p id="toplinks">Skip to: <a href="#content">Content</a> | <a href="#sidebar">Navigation</a> | <a href="#footer">Footer</a></p>
<h1 id="bannerLeft">
<a href="./">
GitHub API for Java
</a>
</h1>
<p id="slogan">GitHub API for Java</p>
</div>
<div id="breadcrumbs">
<div class="xright"> </div>
<div class="clear">
<hr/>
</div>
</div>
<div id="sidebar">
<div id="navcolumn">
<h2>
Git Hub API for Java
</h2><ul>
<li class="none">
<strong>Introduction</strong>
</li>
<li class="none">
<a href="http://mvnrepository.com/artifact/org.kohsuke/github-api">Download</a>
</li>
<li class="none">
<a href="https://github.com/kohsuke/github-api">Source code</a>
</li>
<li class="none">
<a href="https://groups.google.com/forum/#!forum/github-api">Mailing List</a>
</li>
</ul>
<h2>
References
</h2><ul>
<li class="none">
<a href="apidocs/index.html">Javadoc</a>
</li>
</ul>
<h2>
Project Documentation
</h2><ul>
<li class="expanded">
<a href="project-info.html">Project Information</a>
<ul>
<li class="none">
<a href="dependencies.html">Dependencies</a>
</li>
<li class="none">
<a href="dependency-convergence.html">Dependency Convergence</a>
</li>
<li class="none">
<a href="dependency-info.html">Dependency Information</a>
</li>
<li class="none">
<a href="distribution-management.html">Distribution Management</a>
</li>
<li class="none">
<strong>About</strong>
</li>
<li class="none">
<a href="license.html">Project License</a>
</li>
<li class="none">
<a href="mail-lists.html">Mailing Lists</a>
</li>
<li class="none">
<a href="plugin-management.html">Plugin Management</a>
</li>
<li class="none">
<a href="plugins.html">Project Plugins</a>
</li>
<li class="none">
<a href="team-list.html">Project Team</a>
</li>
<li class="none">
<a href="source-repository.html">Source Repository</a>
</li>
<li class="none">
<a href="project-summary.html">Project Summary</a>
</li>
</ul>
</li>
<li class="collapsed">
<a href="project-reports.html">Project Reports</a>
</li>
</ul>
</div>
</div>
<div id="content">
<div id="contentBox">
<h1>What is this?</h1>
<p>This library defines an object oriented representation of the GitHub API. By "object oriented" we mean
there are classes that correspond to the domain model of GitHub (such as <code>GHUser</code> and <code>GHRepository</code>),
operations that act on them as defined as methods (such as <code>GHUser.follow()</code>), and those object references
are used in favor of using string handle (such as <code>GHUser.isMemberOf(GHOrganization)</code> instead of
<code>GHUser.isMemberOf(String)</code>)</p>
<p>The library supports both github.com and GitHub Enterprise.</p>
<p>Most of the GitHub APIs are covered, although there are some corners that are still not yet implemented.</p>
<h2>Sample Usage</h2>
<pre><code>GitHub github = GitHub.connect();
GHRepository repo = github.createRepository(
"new-repository","this is my new repository",
"http://www.kohsuke.org/",true/*public*/);
repo.addCollaborators(github.getUser("abayer"),github.getUser("rtyler"));
repo.delete();
</code></pre>
<h2>Credential</h2>
<p>This library allows the caller to supply the credential as parameters, but it also defines a common convention
so that applications using this library will look at the consistent location. In this convention, the library
looks at <code>~/.github</code> property file, which should have the following two values:</p>
<pre><code>login=kohsuke
password=012345678
</code></pre>
<p>Alternatively, you can have just the OAuth token in this file:</p>
<pre><code>oauth=4d98173f7c075527cb64878561d1fe70
</code></pre>
<h2>OkHttp</h2>
<p>This library comes with a pluggable connector to use different HTTP client implementations
through <code>HttpConnector</code>. In particular, this means you can use <a href="http://square.github.io/okhttp/">OkHttp</a>,
so we can make use of it's HTTP response cache.
Making a conditional request against the GitHub API and receiving a 304 response
<a href="http://developer.github.com/v3/#conditional-requests">does not count against the rate limit</a>.</p>
<p>The following code shows an example of how to set up persistent cache on the disk:</p>
<pre><code>Cache cache = new Cache(cacheDirectory, 10 * 1024 * 1024); // 10MB cache
GitHub gitHub = GitHubBuilder.fromCredentials()
.withConnector(new OkHttpConnector(new OkUrlFactory(new OkHttpClient().setCache(cache))))
.build();
</code></pre>
</div>
</div>
<div id="footer">
<div class="xright">©
2018
<a href="http://kohsuke.org/">Kohsuke Kawaguchi</a> and other contributors
| Last Published: 2018-08-29
| Version: 1.94
</div>
<div class="clear">
<hr/>
</div>
</div>
</div></div>
</body>
</html>