public File downloadFileFromResponse ( Response response ) throws ApiException { try { File file = prepareDownloadFile ( response ) ; Files . copy ( response . readEntity ( InputStream . class ) , file . toPath ( ) ) ; return file ; } catch ( IOException e ) { throw new ApiException ( e ) ; } }
Download file from the given response .