use of com.github.lybgeek.upload.concurrent.FileCallable in project springboot-learning by lyb-geek.
the class FileServiceImpl method sliceUpload.
@Override
public FileUploadDTO sliceUpload(FileUploadRequestDTO fileUploadRequestDTO) {
try {
completionService.submit(new FileCallable(UploadModeEnum.RANDOM_ACCESS, fileUploadRequestDTO));
FileUploadDTO fileUploadDTO = completionService.take().get();
return fileUploadDTO;
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
throw new BizException(e.getMessage(), 406);
} catch (ExecutionException e) {
log.error(e.getMessage(), e);
throw new BizException(e.getMessage(), 406);
}
}
Aggregations