use of co.videofirst.vft.capture.exception.VideoUploadException in project vft-capture by videofirst.
the class DefaultUploadService method upload.
// Methods from `UploadService`
@Override
public void upload(String captureId) {
if (!uploadConfig.isEnable()) {
throw new VideoUploadException("Please enable upload configuration (i.e. set `vft_config.upload.enable` property to `true`)");
}
Capture capture = getCapture(captureId);
// Check capture is finished i.e. the `finished` timestamp is set.
if (capture.getFinished() == null) {
throw new InvalidStateException("You can only upload a capture which is finished. Please try again later.");
}
// Mark capture that it's scheduled for upload
Upload upload = Upload.schedule(uploadConfig.getUrl());
capture.setUpload(upload);
captureDao.save(capture);
uploads.put(captureId, capture);
queue.add(capture);
}
Aggregations