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
a05aaf1f
Commit
a05aaf1f
authored
Sep 09, 2015
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71 from openwide-java/master
minor cosmetic cleanups
parents
2243612f
d3a1479b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+28
-28
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
a05aaf1f
...
@@ -711,56 +711,56 @@ public class GitlabAPI {
...
@@ -711,56 +711,56 @@ public class GitlabAPI {
/**
/**
* Get raw file content
* Get raw file content
*
*
* @param project Project
* @param project
The
Project
* @param sha The commit or branch name
* @param sha The commit or branch name
* @param filepath The path the file
* @param filepath The path
of
the file
* @throws IOException
* @throws IOException
on gitlab api call error
*/
*/
public
byte
[]
getRawFileContent
(
GitlabProject
project
,
String
sha
,
String
filepath
)
throws
IOException
{
public
byte
[]
getRawFileContent
(
GitlabProject
project
,
String
sha
,
String
filepath
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/blobs/"
+
sha
+
"?filepath="
+
filepath
;
Query
query
=
new
Query
()
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
.
append
(
"filepath"
,
filepath
);
}
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/blobs/"
+
sha
+
query
.
toString
();
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
}
/**
/**
* Get the raw file contents for a blob by blob SHA.
* Get the raw file contents for a blob by blob SHA.
*
*
* @param project Project
* @param project
The
Project
* @param sha The commit or branch name
* @param sha The commit or branch name
* @throws IOException
* @throws IOException
on gitlab api call error
*/
*/
public
byte
[]
getRawBlobContent
(
GitlabProject
project
,
String
sha
)
throws
IOException
{
public
byte
[]
getRawBlobContent
(
GitlabProject
project
,
String
sha
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/raw_blobs/"
+
sha
;
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/raw_blobs/"
+
sha
;
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
}
}
/**
/**
* Get an archive of the repository
* Get an archive of the repository
*
*
* @param project Project
* @param project
The
Project
* @throws IOException
* @throws IOException
on gitlab api call error
*/
*/
public
byte
[]
getFileArchive
(
GitlabProject
project
)
throws
IOException
{
public
byte
[]
getFileArchive
(
GitlabProject
project
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/archive"
;
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository/archive"
;
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
return
retrieve
().
to
(
tailUrl
,
byte
[].
class
);
}
}
/**
/**
* Get an archive of the repository
* Get an archive of the repository
*
*
* @param project Project
* @param project
The
Project
* @param path The path inside
repository. Used to get contend
of subdirectories (optional)
* @param path The path inside
the repository. Used to get content
of subdirectories (optional)
* @param ref_name The name of a repository branch or tag or if not given the default branch (optional)
* @param ref_name The name of a repository branch or tag or if not given the default branch (optional)
* @throws IOException
* @throws IOException
on gitlab api call error
*/
*/
public
List
<
GitlabRepositoryTree
>
getRepositoryTree
(
GitlabProject
project
,
String
path
,
String
ref_name
)
throws
IOException
{
public
List
<
GitlabRepositoryTree
>
getRepositoryTree
(
GitlabProject
project
,
String
path
,
String
ref_name
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository"
+
GitlabRepositoryTree
.
URL
;
Query
query
=
new
Query
()
if
(
path
!=
null
)
{
.
appendIf
(
"path"
,
path
)
tailUrl
=
tailUrl
+
(
tailUrl
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
"path="
+
path
;
.
appendIf
(
"ref_name"
,
ref_name
);
}
if
(
ref_name
!=
null
)
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/repository"
+
GitlabRepositoryTree
.
URL
+
query
.
toString
();
tailUrl
=
tailUrl
+
(
tailUrl
.
indexOf
(
'?'
)
>
0
?
'&'
:
'?'
)
+
"ref_name="
+
ref_name
;
}
GitlabRepositoryTree
[]
tree
=
retrieve
().
to
(
tailUrl
,
GitlabRepositoryTree
[].
class
);
GitlabRepositoryTree
[]
tree
=
retrieve
().
to
(
tailUrl
,
GitlabRepositoryTree
[].
class
);
return
Arrays
.
asList
(
tree
);
return
Arrays
.
asList
(
tree
);
}
}
...
...
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