ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [8/8] ant git commit: Java7 way pf creating a temp directory
Date Wed, 21 Dec 2016 19:17:46 GMT
Java7 way pf creating a temp directory


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/476b4ef6
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/476b4ef6
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/476b4ef6

Branch: refs/heads/master
Commit: 476b4ef628febedb4cbb23f7c3856c18a2452010
Parents: 7aeadd7
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Wed Dec 21 20:17:17 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Wed Dec 21 20:17:17 2016 +0100

----------------------------------------------------------------------
 .../tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/476b4ef6/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
index 00fd180..0d9bd13 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
@@ -19,6 +19,7 @@ package org.apache.tools.ant.taskdefs.optional.ejb;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Files;
 import java.util.Enumeration;
 import java.util.Hashtable;
 
@@ -771,12 +772,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool {
      * @throws BuildException if a temp directory cannot be created.
      */
     private File createTempDir() throws IOException {
-        File tmpDir = File.createTempFile("genic", null, null);
-        tmpDir.delete();
-        if (!tmpDir.mkdir()) {
-            throw new IOException("Cannot create the temporary directory '" + tmpDir + "'.");
-        }
-        return tmpDir;
+        return Files.createTempDirectory("genic").toFile();
     }
 
     /**


Mime
View raw message