ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r574360 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/ main/org/apache/tools/ant/taskdefs/optional/unix/ main/org/apache/tools/ant/types/selectors/modifiedselector/ tests/junit/org/apache/tools/ant/taskdefs/ tests/junit/org/a...
Date Mon, 10 Sep 2007 20:19:39 GMT
Author: jkf
Date: Mon Sep 10 13:19:38 2007
New Revision: 574360

URL: http://svn.apache.org/viewvc?rev=574360&view=rev
Log:
TempFile changes (ctd)

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java
    ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Mon Sep 10 13:19:38
2007
@@ -341,8 +341,7 @@
             fcv = new Vector(1);
             fcv.add(fc);
         }
-        File tmpFile = FILE_UTILS.createTempFile("fixcrlf", "", null);
-        tmpFile.deleteOnExit();
+        File tmpFile = FILE_UTILS.createTempFileName("fixcrlf", "", null, true);
         try {
             FILE_UTILS.copyFile(srcFile, tmpFile, null, fcv, false, false,
                 encoding, outputEncoding == null ? encoding : outputEncoding,

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java Mon Sep 10 13:19:38 2007
@@ -577,9 +577,8 @@
 
     /** rename the zip file. */
     private File renameFile() {
-        File renamedFile = FILE_UTILS.createTempFile(
-            "zip", ".tmp", zipFile.getParentFile());
-        renamedFile.deleteOnExit();
+        File renamedFile = FILE_UTILS.createTempFileName(
+            "zip", ".tmp", zipFile.getParentFile(), true);
         try {
             FILE_UTILS.rename(zipFile, renamedFile);
         } catch (SecurityException e) {

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Mon Sep
10 13:19:38 2007
@@ -412,8 +412,8 @@
         File canfil = linkfil.getCanonicalFile();
 
         // rename the resource, thus breaking the link:
-        File temp = FILE_UTILS.createTempFile("symlink", ".tmp",
-                                              canfil.getParentFile());
+        File temp = FILE_UTILS.createTempFileName("symlink", ".tmp",
+                                              canfil.getParentFile(), false);
         try {
             try {
                 FILE_UTILS.rename(canfil, temp);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
Mon Sep 10 13:19:38 2007
@@ -445,7 +445,7 @@
                 // How to handle non-file-Resources? I copy temporarily the
                 // resource to a file and use the file-implementation.
                 FileUtils fu = FileUtils.getFileUtils();
-                File tmpFile = fu.createTempFile("modified-", ".tmp", null);
+                File tmpFile = fu.createTempFileName("modified-", ".tmp", null, true);
                 Resource tmpResource = new FileResource(tmpFile);
                 ResourceUtils.copyResource(resource, tmpResource);
                 boolean isSelected = isSelected(tmpFile.getParentFile(),

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java Mon Sep
10 13:19:38 2007
@@ -347,7 +347,7 @@
             return;
         }
         myBuild = new MonitoredBuild(new File(System.getProperty("root"), BUILD_FILE), "spawn");
-        logFile = FILE_UTILS.createTempFile("spawn","log", project.getBaseDir());
+        logFile = FILE_UTILS.createTempFileName("spawn","log", project.getBaseDir(), false);
         // this is guaranteed by FileUtils#createTempFile
         assertTrue("log file not existing", !logFile.exists());
         // make the spawned process run 4 seconds

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java Mon Sep 10
13:19:38 2007
@@ -175,7 +175,7 @@
     }
 
     public void testSpawn() {
-        File logFile = FILE_UTILS.createTempFile("spawn","log", project.getBaseDir());
+        File logFile = FILE_UTILS.createTempFileName("spawn","log", project.getBaseDir(),
false);
         // this is guaranteed by FileUtils#createTempFile
         assertTrue("log file not existing", !logFile.exists());
         project.setProperty("logFile", logFile.getAbsolutePath());

Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java?rev=574360&r1=574359&r2=574360&view=diff
==============================================================================
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
Mon Sep 10 13:19:38 2007
@@ -391,7 +391,7 @@
      * configure() method of ModifiedSelector. This testcase tests that.
      */
     public void testCreatePropertiesCacheViaCustomSelector() {
-        File cachefile = FILE_UTILS.createTempFile("tmp-cache-", ".properties", null);
+        File cachefile = FILE_UTILS.createTempFileName("tmp-cache-", ".properties", null,
false);
         try {
             // initialize test environment (called "bed")
             makeBed();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message