use of org.wso2.carbon.bpmn.rest.model.repository.DeploymentResourceResponseCollection in project carbon-business-process by wso2.
the class DeploymentService method getDeploymentResources.
@GET
@Path("/{deploymentId}/resources")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getDeploymentResources(@PathParam("deploymentId") String deploymentId) {
RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
// Check if deployment exists
Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
if (deployment == null) {
throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
}
List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);
DeploymentResourceResponseCollection deploymentResourceResponseCollection = new RestResponseFactory().createDeploymentResourceResponseList(deploymentId, resourceList, uriInfo.getBaseUri().toString());
return Response.ok().entity(deploymentResourceResponseCollection).build();
}
Aggregations