use of com.odysseusinc.arachne.storage.util.FileSaveRequest in project ArachneCentralAPI by OHDSI.
the class BaseSubmissionServiceImpl method createResultFilesBatch.
@Override
@Transactional
public List<ResultFile> createResultFilesBatch(List<FileSaveRequest> fileSaveRequests, Submission submission, Long createById) throws IOException {
fileSaveRequests.forEach(entry -> entry.setDestinationFilepath(contentStorageHelper.getResultFilesDir(submission, entry.getDestinationFilepath())));
List<ArachneFileMeta> metaList = contentStorageService.saveBatch(fileSaveRequests, createById);
return metaList.stream().map(fm -> {
ResultFile resultFile = new ResultFile();
resultFile.setSubmission(submission);
resultFile.setPath(fm.getPath());
return resultFile;
}).collect(Collectors.toList());
}
Aggregations