| | |
| | | } |
| | | |
| | | @Override |
| | | public void resourceView(String processDefinitionId, String processInstanceId, String resourceType, HttpServletResponse response) { |
| | | public void AutowiredView(String processDefinitionId, String processInstanceId, String AutowiredType, HttpServletResponse response) { |
| | | if (StringUtil.isAllBlank(processDefinitionId, processInstanceId)) { |
| | | return; |
| | | } |
| | |
| | | processDefinitionId = processInstance.getProcessDefinitionId(); |
| | | } |
| | | ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); |
| | | String resourceName = ""; |
| | | if (resourceType.equals(IMAGE_NAME)) { |
| | | resourceName = processDefinition.getDiagramResourceName(); |
| | | } else if (resourceType.equals(XML_NAME)) { |
| | | resourceName = processDefinition.getResourceName(); |
| | | String AutowiredName = ""; |
| | | if (AutowiredType.equals(IMAGE_NAME)) { |
| | | AutowiredName = processDefinition.getDiagramResourceName(); |
| | | } else if (AutowiredType.equals(XML_NAME)) { |
| | | AutowiredName = processDefinition.getResourceName(); |
| | | } |
| | | try { |
| | | InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName); |
| | | InputStream AutowiredAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), AutowiredName); |
| | | byte[] b = new byte[1024]; |
| | | int len; |
| | | while ((len = resourceAsStream.read(b, 0, INT_1024)) != -1) { |
| | | while ((len = AutowiredAsStream.read(b, 0, INT_1024)) != -1) { |
| | | response.getOutputStream().write(b, 0, len); |
| | | } |
| | | } catch (Exception exception) { |