Commit 66c2194e authored by Greg Messner's avatar Greg Messner
Browse files

Fixed issue using Path on Windows (#270).

parent 336d82b6
...@@ -332,7 +332,9 @@ public class JobApi extends AbstractApi implements Constants { ...@@ -332,7 +332,9 @@ public class JobApi extends AbstractApi implements Constants {
*/ */
public File downloadSingleArtifactsFile(Object projectIdOrPath, Integer jobId, Path artifactPath, File directory) throws GitLabApiException { 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 { try {
if (directory == null) if (directory == null)
...@@ -364,7 +366,9 @@ public class JobApi extends AbstractApi implements Constants { ...@@ -364,7 +366,9 @@ public class JobApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs * @throws GitLabApiException if any exception occurs
*/ */
public InputStream downloadSingleArtifactsFile(Object projectIdOrPath, Integer jobId, Path artifactPath) throws GitLabApiException { 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)); return (response.readEntity(InputStream.class));
} }
...@@ -380,7 +384,8 @@ public class JobApi extends AbstractApi implements Constants { ...@@ -380,7 +384,8 @@ public class JobApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs during execution * @throws GitLabApiException if any exception occurs during execution
*/ */
public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException { 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)); return (response.readEntity(String.class));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment