Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
a9cbe1f9
Commit
a9cbe1f9
authored
Mar 24, 2014
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from pweingardt/master
getNamespaceMembers and getCurrentSession
parents
cd037b61
1a383ac7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+29
-2
GitlabNamespace.java
src/main/java/org/gitlab/api/models/GitlabNamespace.java
+2
-1
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
a9cbe1f9
...
...
@@ -15,11 +15,12 @@ import org.gitlab.api.models.GitlabCommit;
import
org.gitlab.api.models.GitlabIssue
;
import
org.gitlab.api.models.GitlabMergeRequest
;
import
org.gitlab.api.models.GitlabMilestone
;
import
org.gitlab.api.models.GitlabNamespace
;
import
org.gitlab.api.models.GitlabNote
;
import
org.gitlab.api.models.GitlabProject
;
import
org.gitlab.api.models.GitlabProjectHook
;
import
org.gitlab.api.models.GitlabSession
;
import
org.gitlab.api.models.GitlabProjectMember
;
import
org.gitlab.api.models.GitlabSession
;
/**
* Gitlab API Wrapper class
...
...
@@ -92,7 +93,7 @@ public class GitlabAPI {
public
List
<
GitlabProject
>
getProjects
()
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
;
return
Arrays
.
asList
(
retrieve
().
to
(
tailUrl
,
GitlabProject
[].
class
)
);
return
retrieve
().
getAll
(
tailUrl
,
GitlabProject
[].
class
);
}
public
List
<
GitlabProject
>
getAllProjects
()
throws
IOException
{
...
...
@@ -300,4 +301,30 @@ public class GitlabAPI {
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
projectId
+
GitlabProjectMember
.
URL
;
return
Arrays
.
asList
(
retrieve
().
to
(
tailUrl
,
GitlabProjectMember
[].
class
));
}
/**
* This will fail, if the given namespace is a user and not a group
* @param namespace
* @return
* @throws IOException
*/
public
List
<
GitlabProjectMember
>
getNamespaceMembers
(
GitlabNamespace
namespace
)
throws
IOException
{
return
getNamespaceMembers
(
namespace
.
getId
());
}
/**
* This will fail, if the given namespace is a user and not a group
* @param namespaceId
* @return
* @throws IOException
*/
public
List
<
GitlabProjectMember
>
getNamespaceMembers
(
Integer
namespaceId
)
throws
IOException
{
String
tailUrl
=
GitlabNamespace
.
URL
+
"/"
+
namespaceId
+
GitlabProjectMember
.
URL
;
return
Arrays
.
asList
(
retrieve
().
to
(
tailUrl
,
GitlabProjectMember
[].
class
));
}
public
GitlabSession
getCurrentSession
()
throws
IOException
{
String
tailUrl
=
"/user"
;
return
retrieve
().
to
(
tailUrl
,
GitlabSession
.
class
);
}
}
src/main/java/org/gitlab/api/models/GitlabNamespace.java
View file @
a9cbe1f9
...
...
@@ -4,7 +4,8 @@ import java.util.Date;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabNamespace
{
public
static
final
String
URL
=
"/groups"
;
private
Integer
_id
;
private
String
_name
;
private
String
_path
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment