Skip to content

Commit

Permalink
Switched file name for tmp file to avoid NPE (related to #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
berndruecker committed Jul 11, 2022
1 parent b92070f commit d3ddc3d
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -17,6 +17,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

/**
* Auto deploys all Camunda resources found on classpath during startup of the application
Expand Down Expand Up @@ -61,8 +62,7 @@ public void deployCamundaResources() throws IOException, ApiException {
resourcesToDeploy.addAll(Arrays.asList( patternResolver.getResources(formResourcesPattern) ));

for (Resource camundaResource: resourcesToDeploy) {
//ResourceUtils.getFile(camundaResource.getURI());
final File tempFile = File.createTempFile(camundaResource.getFilename(), ".tmp");
final File tempFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp");
tempFile.deleteOnExit();
try (FileOutputStream out = new FileOutputStream(tempFile)) {
IOUtils.copy(camundaResource.getInputStream(), out);
Expand Down

0 comments on commit d3ddc3d

Please sign in to comment.