44import java .io .IOException ;
55import java .io .InputStream ;
66import java .nio .file .Files ;
7- import java .nio .file .Path ;
87import java .nio .file .StandardCopyOption ;
98import java .util .List ;
109import java .util .Optional ;
@@ -462,17 +461,16 @@ public InputStream downloadArtifactsFile(Object projectIdOrPath, Long jobId, Art
462461 * @return a File instance pointing to the download of the specified artifacts file
463462 * @throws GitLabApiException if any exception occurs
464463 */
465- public File downloadSingleArtifactsFile (Object projectIdOrPath , Long jobId , Path artifactPath , File directory ) throws GitLabApiException {
464+ public File downloadSingleArtifactsFile (Object projectIdOrPath , Long jobId , String artifactPath , File directory ) throws GitLabApiException {
466465
467- String path = artifactPath .toString ().replace ("\\ " , "/" );
468466 Response response = get (Response .Status .OK , getDefaultPerPageParam (),
469- "projects" , getProjectIdOrPath (projectIdOrPath ), "jobs" , jobId , "artifacts" , path );
467+ "projects" , getProjectIdOrPath (projectIdOrPath ), "jobs" , jobId , "artifacts" , artifactPath );
470468 try {
471469
472470 if (directory == null )
473471 directory = new File (System .getProperty ("java.io.tmpdir" ));
474472
475- String filename = artifactPath . getFileName (). toString () ;
473+ String filename = artifactPath ;
476474 File file = new File (directory , filename );
477475
478476 InputStream in = response .readEntity (InputStream .class );
@@ -497,10 +495,9 @@ public File downloadSingleArtifactsFile(Object projectIdOrPath, Long jobId, Path
497495 * @return an InputStream to read the specified artifacts file from
498496 * @throws GitLabApiException if any exception occurs
499497 */
500- public InputStream downloadSingleArtifactsFile (Object projectIdOrPath , Long jobId , Path artifactPath ) throws GitLabApiException {
501- String path = artifactPath .toString ().replace ("\\ " , "/" );
498+ public InputStream downloadSingleArtifactsFile (Object projectIdOrPath , Long jobId , String artifactPath ) throws GitLabApiException {
502499 Response response = get (Response .Status .OK , getDefaultPerPageParam (),
503- "projects" , getProjectIdOrPath (projectIdOrPath ), "jobs" , jobId , "artifacts" , path );
500+ "projects" , getProjectIdOrPath (projectIdOrPath ), "jobs" , jobId , "artifacts" , artifactPath );
504501 return (response .readEntity (InputStream .class ));
505502 }
506503
0 commit comments