use of com.synopsys.integration.alert.common.rest.model.ExistenceModel in project blackduck-alert by blackducksoftware.
the class AbstractUploadAction method uploadFileExists.
public ActionResponse<ExistenceModel> uploadFileExists() {
if (isTargetUndefined()) {
return new ActionResponse<>(HttpStatus.INTERNAL_SERVER_ERROR, META_DATA_MISSING);
}
if (!authorizationManager.hasUploadReadPermission(target.getContext(), target.getDescriptorKey())) {
return new ActionResponse<>(HttpStatus.FORBIDDEN, ActionResponse.FORBIDDEN_MESSAGE);
}
String targetFilename = target.getFilename();
Boolean exists = filePersistenceUtil.uploadFileExists(targetFilename);
ExistenceModel content = new ExistenceModel(exists);
return new ActionResponse<>(HttpStatus.OK, content);
}
use of com.synopsys.integration.alert.common.rest.model.ExistenceModel in project hub-alert by blackducksoftware.
the class AbstractUploadAction method uploadFileExists.
public ActionResponse<ExistenceModel> uploadFileExists() {
if (isTargetUndefined()) {
return new ActionResponse<>(HttpStatus.INTERNAL_SERVER_ERROR, META_DATA_MISSING);
}
if (!authorizationManager.hasUploadReadPermission(target.getContext(), target.getDescriptorKey())) {
return new ActionResponse<>(HttpStatus.FORBIDDEN, ActionResponse.FORBIDDEN_MESSAGE);
}
String targetFilename = target.getFilename();
Boolean exists = filePersistenceUtil.uploadFileExists(targetFilename);
ExistenceModel content = new ExistenceModel(exists);
return new ActionResponse<>(HttpStatus.OK, content);
}
Aggregations