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 13:55:40 GMT
conor       00/06/30 06:55:38

  Modified:    src/main/org/apache/tools/ant/taskdefs Delete.java
                        Deltree.java
  Log:
  Change delete failure checks to use return code rather than separate call
  to exists
  
  Revision  Changes    Path
  1.5       +2 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Delete.java	2000/06/30 12:51:04	1.4
  +++ Delete.java	2000/06/30 13:55:32	1.5
  @@ -123,8 +123,7 @@
           }
           else {
             project.log("Deleting: " + f.getAbsolutePath());
  -          f.delete();
  -	  if (f.exists()) {
  +          if (!f.delete()) {
   	      throw new BuildException("Unable to delete file " + f.getAbsolutePath());
             }
           }
  @@ -148,8 +147,7 @@
   
           if (f.exists()) {
             project.log("Deleting: " + f.getAbsolutePath(), verbosity);
  -          f.delete();
  -	  if (f.exists()) {
  +          if (!f.delete()) {
   	      throw new BuildException("Unable to delete " + f.getAbsolutePath());
             }
           }
  
  
  
  1.4       +3 -6      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Deltree.java	2000/06/30 12:51:05	1.3
  +++ Deltree.java	2000/06/30 13:55:32	1.4
  @@ -76,8 +76,7 @@
   
   	if (dir.exists()) {
   	    if (!dir.isDirectory()) {
  -		dir.delete();
  -		if (dir.exists()) {
  +		if (!dir.delete()) {
           	    throw new BuildException("Unable to delete file " + dir.getAbsolutePath());
   	        }
   		return;
  @@ -110,14 +109,12 @@
   	    if (f.isDirectory()) {
   		removeDir(f);
   	    } else {
  -		f.delete();
  -		if (f.exists()) {
  +		if (!f.delete()) {
           	    throw new BuildException("Unable to delete file " + f.getAbsolutePath());
   	        }
   	    }
   	}
  -        dir.delete();
  -	if (dir.exists()) {
  +        if (!dir.delete()) {
   	    throw new BuildException("Unable to delete directory " + dir.getAbsolutePath());
   	}
       }
  
  
  

Mime
View raw message