Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
66c2194e
Commit
66c2194e
authored
Nov 12, 2018
by
Greg Messner
Browse files
Fixed issue using Path on Windows (#270).
parent
336d82b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/JobApi.java
View file @
66c2194e
...
...
@@ -332,7 +332,9 @@ public class JobApi extends AbstractApi implements Constants {
*/
public
File
downloadSingleArtifactsFile
(
Object
projectIdOrPath
,
Integer
jobId
,
Path
artifactPath
,
File
directory
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"artifacts"
,
artifactPath
);
String
path
=
artifactPath
.
toString
().
replace
(
"\\"
,
"/"
);
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"artifacts"
,
path
);
try
{
if
(
directory
==
null
)
...
...
@@ -364,7 +366,9 @@ public class JobApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs
*/
public
InputStream
downloadSingleArtifactsFile
(
Object
projectIdOrPath
,
Integer
jobId
,
Path
artifactPath
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"artifacts"
,
artifactPath
);
String
path
=
artifactPath
.
toString
().
replace
(
"\\"
,
"/"
);
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"artifacts"
,
path
);
return
(
response
.
readEntity
(
InputStream
.
class
));
}
...
...
@@ -380,7 +384,8 @@ public class JobApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs during execution
*/
public
String
getTrace
(
Object
projectIdOrPath
,
int
jobId
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"trace"
);
Response
response
=
get
(
Response
.
Status
.
OK
,
getDefaultPerPageParam
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"jobs"
,
jobId
,
"trace"
);
return
(
response
.
readEntity
(
String
.
class
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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