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 Copyfile.java
Date Thu, 17 Aug 2000 15:40:19 GMT
conor       00/08/17 08:40:19

  Modified:    src/main/org/apache/tools/ant/taskdefs Copyfile.java
  Log:
  Add forceoverwrite option to copyfile task
  
  Submitted by:	Uli Stehling <uli.stehling@informationsdesign.de>
  
  Revision  Changes    Path
  1.4       +8 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copyfile.java
  
  Index: Copyfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copyfile.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Copyfile.java	2000/02/14 12:19:27	1.3
  +++ Copyfile.java	2000/08/17 15:40:19	1.4
  @@ -70,11 +70,16 @@
       private File srcFile;
       private File destFile;
       private boolean filtering = false;
  -
  +    private boolean forceOverwrite = false;
  + 
       public void setSrc(String src) {
           srcFile = project.resolveFile(src);
       }
   
  +    public void setForceoverwrite(String force) {
  +        forceOverwrite = Project.toBoolean(force);
  +    }
  +
       public void setDest(String dest) {
           destFile = project.resolveFile(dest);
       }
  @@ -84,9 +89,9 @@
       }
   
       public void execute() throws BuildException {
  -        if (srcFile.lastModified() > destFile.lastModified()) {
  +        if (forceOverwrite || srcFile.lastModified() > destFile.lastModified()) {
               try {
  -                project.copyFile(srcFile, destFile, filtering);
  +                project.copyFile(srcFile, destFile, filtering, forceOverwrite);
               } catch (IOException ioe) {
                   String msg = "Error copying file: " + srcFile.getAbsolutePath()
                       + " due to " + ioe.getMessage();
  
  
  

Mime
View raw message