ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Delete.java Deltree.java
Date Fri, 30 Jun 2000 12:51:06 GMT
conor       00/06/30 05:51:06

  Modified:    src/main/org/apache/tools/ant/taskdefs Delete.java
                        Deltree.java
  Log:
  Detect situations when files and directories cannot be deleted.
  
  Revision  Changes    Path
  1.4       +6 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java
  
  Index: Delete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Delete.java	2000/06/16 01:46:13	1.3
  +++ Delete.java	2000/06/30 12:51:04	1.4
  @@ -124,6 +124,9 @@
           else {
             project.log("Deleting: " + f.getAbsolutePath());
             f.delete();
  +	  if (f.exists()) {
  +	      throw new BuildException("Unable to delete file " + f.getAbsolutePath());
  +          }
           }
         }
       }
  @@ -146,6 +149,9 @@
           if (f.exists()) {
             project.log("Deleting: " + f.getAbsolutePath(), verbosity);
             f.delete();
  +	  if (f.exists()) {
  +	      throw new BuildException("Unable to delete " + f.getAbsolutePath());
  +          }
           }
         }
       }
  
  
  
  1.3       +9 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java
  
  Index: Deltree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Deltree.java	2000/02/24 01:34:45	1.2
  +++ Deltree.java	2000/06/30 12:51:05	1.3
  @@ -77,6 +77,9 @@
   	if (dir.exists()) {
   	    if (!dir.isDirectory()) {
   		dir.delete();
  +		if (dir.exists()) {
  +        	    throw new BuildException("Unable to delete file " + dir.getAbsolutePath());
  +	        }
   		return;
   		// String msg = "Given dir: " + dir.getAbsolutePath() +
   		// " is not a dir";
  @@ -108,10 +111,15 @@
   		removeDir(f);
   	    } else {
   		f.delete();
  +		if (f.exists()) {
  +        	    throw new BuildException("Unable to delete file " + f.getAbsolutePath());
  +	        }
   	    }
   	}
  -	    //        }
           dir.delete();
  +	if (dir.exists()) {
  +	    throw new BuildException("Unable to delete directory " + dir.getAbsolutePath());
  +	}
       }
   }
   
  
  
  

Mime
View raw message