public InputStream downloadArtifactsFile ( Object projectIdOrPath , String ref , String jobName ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "job" , jobName , true ) ; Response response = getWithAccepts ( Response . Status . OK , formData . asMap ( ) , MediaType . MEDIA_TYPE_WILDCARD , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , "artifacts" , ref , "download" ) ; return ( response . readEntity ( InputStream . class ) ) ; }
Get an InputStream pointing to the artifacts file from the given reference name and job provided the job finished successfully . The file will be saved to the specified directory . If the file already exists in the directory it will be overwritten .