diff --git a/src/main/java/hockeyapp/HockeyappRecorder.java b/src/main/java/hockeyapp/HockeyappRecorder.java index f40e24a..b55b42e 100644 --- a/src/main/java/hockeyapp/HockeyappRecorder.java +++ b/src/main/java/hockeyapp/HockeyappRecorder.java @@ -24,6 +24,7 @@ import org.kohsuke.stapler.DataBoundConstructor; import hudson.scm.ChangeLogSet.Entry; import java.io.*; +import java.nio.file.Files; import java.util.*; import net.sf.json.JSONObject; @@ -137,9 +138,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, EnvVars vars = build.getEnvironment(listener); // Copy remote file to local file system. - tempDir = File.createTempFile("jtf", null); - tempDir.delete(); - tempDir.mkdirs(); + tempDir = Files.createTempDirectory("jtf").toFile(); File file = getFileLocally(build.getWorkspace(), vars.expand(filePath), tempDir);