ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/unix Symlink.java
Date Tue, 14 Oct 2003 13:19:54 GMT
bodewig     2003/10/14 06:19:53

  Modified:    src/main/org/apache/tools/ant/taskdefs FixCRLF.java
                        Javadoc.java Replace.java Zip.java
               src/main/org/apache/tools/ant/taskdefs/compilers
                        DefaultCompilerAdapter.java
               src/main/org/apache/tools/ant/taskdefs/cvslib
                        CvsTagDiff.java
               src/main/org/apache/tools/ant/taskdefs/optional Cab.java
                        ReplaceRegExp.java
               src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
               src/main/org/apache/tools/ant/taskdefs/optional/metamata
                        AbstractMetamataTask.java
               src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
               src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        CovMerge.java Coverage.java
               src/main/org/apache/tools/ant/taskdefs/optional/unix
                        Symlink.java
  Log:
  More robust cleanup of temporary files, PR 17512
  
  Revision  Changes    Path
  1.55      +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
  
  Index: FixCRLF.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- FixCRLF.java	16 Sep 2003 09:08:55 -0000	1.54
  +++ FixCRLF.java	14 Oct 2003 13:19:52 -0000	1.55
  @@ -404,6 +404,7 @@
               // Set up the output Writer
               try {
                   tmpFile = fileUtils.createTempFile("fixcrlf", "", null);
  +                tmpFile.deleteOnExit();
                   Writer writer = (encoding == null) ? new FileWriter(tmpFile)
                       : new OutputStreamWriter(new FileOutputStream(tmpFile),
                                                encoding);
  
  
  
  1.125     +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.124
  retrieving revision 1.125
  diff -u -r1.124 -r1.125
  --- Javadoc.java	16 Sep 2003 09:08:55 -0000	1.124
  +++ Javadoc.java	14 Oct 2003 13:19:52 -0000	1.125
  @@ -1919,6 +1919,7 @@
               if (useExternalFile) {
                   if (tmpList == null) {
                       tmpList = fileUtils.createTempFile("javadoc", "", null);
  +                    tmpList.deleteOnExit();
                       toExecute.createArgument()
                           .setValue("@" + tmpList.getAbsolutePath());
                   }
  
  
  
  1.48      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Replace.java	13 Aug 2003 14:46:15 -0000	1.47
  +++ Replace.java	14 Oct 2003 13:19:52 -0000	1.48
  @@ -399,6 +399,7 @@
   
           File temp = fileUtils.createTempFile("rep", ".tmp",
                                                fileUtils.getParentFile(src));
  +        temp.deleteOnExit();
   
           Reader reader = null;
           Writer writer = null;
  
  
  
  1.117     +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- Zip.java	16 Sep 2003 09:08:56 -0000	1.116
  +++ Zip.java	14 Oct 2003 13:19:52 -0000	1.117
  @@ -416,6 +416,7 @@
                   renamedFile =
                       fileUtils.createTempFile("zip", ".tmp",
                                                fileUtils.getParentFile(zipFile));
  +                renamedFile.deleteOnExit();
   
                   try {
                       fileUtils.rename(zipFile, renamedFile);
  
  
  
  1.42      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- DefaultCompilerAdapter.java	16 Sep 2003 09:08:57 -0000	1.41
  +++ DefaultCompilerAdapter.java	14 Oct 2003 13:19:52 -0000	1.42
  @@ -445,6 +445,7 @@
                           userDir = new File(userDirName);
                       }
                       tmpFile = fileUtils.createTempFile("files", "", userDir);
  +                    tmpFile.deleteOnExit();
                       out = new PrintWriter(new FileWriter(tmpFile));
                       for (int i = firstFileName; i < args.length; i++) {
                           if (quoteFiles && args[i].indexOf(" ") > -1) {
  
  
  
  1.17      +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
  
  Index: CvsTagDiff.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CvsTagDiff.java	11 Jul 2003 09:13:16 -0000	1.16
  +++ CvsTagDiff.java	14 Oct 2003 13:19:53 -0000	1.17
  @@ -245,6 +245,7 @@
           File tmpFile = null;
           try {
               tmpFile = myfileUtils.createTempFile("cvstagdiff", ".log", null);
  +            tmpFile.deleteOnExit();
               setOutput(tmpFile);
   
               // run the cvs command
  
  
  
  1.30      +2 -0      ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Cab.java	25 Jul 2003 12:14:42 -0000	1.29
  +++ Cab.java	14 Oct 2003 13:19:53 -0000	1.30
  @@ -192,6 +192,7 @@
       protected File createListFile(Vector files)
           throws IOException {
           File listFile = fileUtils.createTempFile("ant", "", null);
  +        listFile.deleteOnExit();
   
           PrintWriter writer = new PrintWriter(new FileOutputStream(listFile));
   
  @@ -322,6 +323,7 @@
   
                   if (!doVerbose) {
                       outFile = fileUtils.createTempFile("ant", "", null);
  +                    outFile.deleteOnExit();
                       exec.setOutput(outFile);
                   }
   
  
  
  
  1.30      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
  
  Index: ReplaceRegExp.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ReplaceRegExp.java	9 Oct 2003 08:15:33 -0000	1.29
  +++ ReplaceRegExp.java	14 Oct 2003 13:19:53 -0000	1.30
  @@ -322,6 +322,7 @@
       protected void doReplace(File f, int options)
            throws IOException {
           File temp = fileUtils.createTempFile("replace", ".txt", null);
  +        temp.deleteOnExit();
   
           Reader r = null;
           Writer w = null;
  
  
  
  1.86      +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- JUnitTask.java	10 Oct 2003 13:38:25 -0000	1.85
  +++ JUnitTask.java	14 Oct 2003 13:19:53 -0000	1.86
  @@ -769,6 +769,7 @@
           File propsFile =
               FileUtils.newFileUtils().createTempFile("junit", ".properties",
                   tmpDir != null ? tmpDir : getProject().getBaseDir());
  +        propsFile.deleteOnExit();
           cmd.createArgument().setValue("propsfile="
                                         + propsFile.getAbsolutePath());
           Hashtable p = getProject().getProperties();
  
  
  
  1.17      +4 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
  
  Index: AbstractMetamataTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractMetamataTask.java	1 Aug 2003 10:08:12 -0000	1.16
  +++ AbstractMetamataTask.java	14 Oct 2003 13:19:53 -0000	1.17
  @@ -320,7 +320,10 @@
       }
   
       protected final File createTmpFile() {
  -        return FileUtils.newFileUtils().createTempFile("metamata", ".tmp", getProject().getBaseDir());
  +        File tmpFile = FileUtils.newFileUtils()
  +            .createTempFile("metamata", ".tmp", getProject().getBaseDir());
  +        tmpFile.deleteOnExit();
  +        return tmpFile;
       }
   
       /**
  
  
  
  1.54      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- FTP.java	13 Oct 2003 19:53:01 -0000	1.53
  +++ FTP.java	14 Oct 2003 13:19:53 -0000	1.54
  @@ -1576,6 +1576,7 @@
                   throw new BuildException(ioe, getLocation());
               }
               if (!found) {
  +                localFile.deleteOnExit();
                   return localFile;
               }
           }
  
  
  
  1.23      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  
  Index: CovMerge.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CovMerge.java	25 Jul 2003 12:14:44 -0000	1.22
  +++ CovMerge.java	14 Oct 2003 13:19:53 -0000	1.23
  @@ -196,6 +196,7 @@
       protected File createParamFile() throws BuildException {
           File[] snapshots = getSnapshots();
           File file = createTempFile("jpcovm");
  +        file.deleteOnExit();
           FileWriter fw = null;
           try {
               fw = new FileWriter(file);
  
  
  
  1.19      +1 -0      ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Coverage.java	25 Jul 2003 12:14:44 -0000	1.18
  +++ Coverage.java	14 Oct 2003 13:19:53 -0000	1.19
  @@ -449,6 +449,7 @@
       protected File createParamFile() throws BuildException {
           //@todo change this when switching to JDK 1.2 and use File.createTmpFile()
           File file = createTempFile("jpcov");
  +        file.deleteOnExit();
           log("Creating parameter file: " + file, Project.MSG_VERBOSE);
   
           // options need to be one per line in the parameter file
  
  
  
  1.13      +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
  
  Index: Symlink.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Symlink.java	22 Aug 2003 15:25:45 -0000	1.12
  +++ Symlink.java	14 Oct 2003 13:19:53 -0000	1.13
  @@ -417,6 +417,7 @@
           File parentDir = new File(parentStr);
           FileUtils fu = FileUtils.newFileUtils();
           File temp = fu.createTempFile("symlink", ".tmp", parentDir);
  +        temp.deleteOnExit();
           try {
               try {
                   fu.rename(canfil, temp);
  
  
  

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


Mime
View raw message