use of org.camunda.bpm.engine.exception.DeploymentResourceNotFoundException in project camunda-bpm-platform by camunda.
the class AbstractGetDeployedFormCmd method execute.
public InputStream execute(final CommandContext commandContext) {
checkAuthorization(commandContext);
final FormData formData = getFormData(commandContext);
String formKey = formData.getFormKey();
if (formKey == null) {
throw new BadUserRequestException("The form key is not set.");
}
final String resourceName = getResourceName(formKey);
try {
return commandContext.runWithoutAuthorization(new Callable<InputStream>() {
@Override
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(formData.getDeploymentId(), resourceName).execute(commandContext);
}
});
} catch (DeploymentResourceNotFoundException e) {
throw new NotFoundException("The form with the resource name '" + resourceName + "' cannot be found in deployment.", e);
}
}
Aggregations