@Override
public void startMultipartUpload(long actor, long file, String uploadId, String destinationPath) {
final FileMetaData entity = load(file);
if (!entity.getOwner().equals(Util.USER_FROM_ID.apply(actor))) {
throw new AccessDenied("Only owner can set upload ID");
}
if (RuleValidatorImpl.IS_UPLOAD_COMPLETE.apply(entity)) {
throw new AccessDenied("Content already set, cannot set upload ID");
}
entity.setUploadId(uploadId);
entity.setDestinationPath(destinationPath);
logger.debug("The multipart upload ID = " + file + " for user " + actor + " has been set: " + uploadId);
fileRepository.save(entity);