ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Copy.java
Date Mon, 14 Oct 2002 10:28:55 GMT
bodewig     2002/10/14 03:28:55

  Modified:    src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
                        Copy.java
  Log:
  merge from HEAD
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.42.2.3  +17 -16    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java
  
  Index: Copy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v
  retrieving revision 1.42.2.2
  retrieving revision 1.42.2.3
  diff -u -r1.42.2.2 -r1.42.2.3
  --- Copy.java	24 Jun 2002 02:28:08 -0000	1.42.2.2
  +++ Copy.java	14 Oct 2002 10:28:54 -0000	1.42.2.3
  @@ -280,9 +280,9 @@
       public Mapper createMapper() throws BuildException {
           if (mapperElement != null) {
               throw new BuildException("Cannot define more than one mapper",
  -                                     location);
  +                                     getLocation());
           }
  -        mapperElement = new Mapper(project);
  +        mapperElement = new Mapper(getProject());
           return mapperElement;
       }
   
  @@ -316,12 +316,12 @@
               // will be removed in validateAttributes
               savedFileSet = (FileSet) filesets.elementAt(0);
           }
  -        
  +
           // make sure we don't have an illegal set of options
           validateAttributes();
   
           try {
  -            
  +
               // deal with the single file
               if (file != null) {
                   if (file.exists()) {
  @@ -330,6 +330,7 @@
                       }
   
                       if (forceOverwrite ||
  +                        !destFile.exists() ||
                           (file.lastModified() > destFile.lastModified())) {
                           fileCopyMap.put(file.getAbsolutePath(), 
                                           destFile.getAbsolutePath());
  @@ -351,9 +352,9 @@
               // deal with the filesets
               for (int i = 0; i < filesets.size(); i++) {
                   FileSet fs = (FileSet) filesets.elementAt(i);
  -                DirectoryScanner ds = fs.getDirectoryScanner(project);
  -                File fromDir = fs.getDir(project);
  -                
  +                DirectoryScanner ds = fs.getDirectoryScanner(getProject());
  +                File fromDir = fs.getDir(getProject());
  +
                   String[] srcFiles = ds.getIncludedFiles();
                   String[] srcDirs = ds.getIncludedDirectories();
                   boolean isEverythingIncluded = ds.isEverythingIncluded();
  @@ -363,7 +364,7 @@
                   }
                   scan(fromDir, destDir, srcFiles, srcDirs);
               }
  -            
  +
               // do all the copy operations now...
               doFileOperations();
           } finally {
  @@ -416,7 +417,7 @@
                       "Cannot concatenate multiple files into a single file.");
               } else {
                   FileSet fs = (FileSet) filesets.elementAt(0);
  -                DirectoryScanner ds = fs.getDirectoryScanner(project);
  +                DirectoryScanner ds = fs.getDirectoryScanner(getProject());
                   String[] srcFiles = ds.getIncludedFiles();
   
                   if (srcFiles.length == 0) {
  @@ -517,21 +518,21 @@
                           new FilterSetCollection();
                       if (filtering) {
                           executionFilters
  -                            .addFilterSet(project.getGlobalFilterSet());
  +                            .addFilterSet(getProject().getGlobalFilterSet());
                       }
                       for (Enumeration filterEnum = filterSets.elements(); 
                            filterEnum.hasMoreElements();) {
                           executionFilters
                               .addFilterSet((FilterSet) filterEnum.nextElement());
                       }
  -                    fileUtils.copyFile(fromFile, toFile, executionFilters, 
  -                                       filterChains, forceOverwrite, 
  -                                       preserveLastModified, encoding, 
  -                                       project);
  +                    fileUtils.copyFile(fromFile, toFile, executionFilters,
  +                                       filterChains, forceOverwrite,
  +                                       preserveLastModified, encoding,
  +                                       getProject());
                   } catch (IOException ioe) {
                       String msg = "Failed to copy " + fromFile + " to " + toFile
                           + " due to " + ioe.getMessage();
  -                    throw new BuildException(msg, ioe, location);
  +                    throw new BuildException(msg, ioe, getLocation());
                   }
               }
           }
  
  
  

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


Mime
View raw message