ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/image Image.java
Date Thu, 29 Aug 2002 17:13:33 GMT
ehatcher    2002/08/29 10:13:33

  Modified:    .        build.xml
               src/main/org/apache/tools/ant/taskdefs/optional/image
                        Image.java
  Log:
  More patches (+ test cases!) from Eric Pugh on the <image> task.
  
  Revision  Changes    Path
  1.316     +2 -0      jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.315
  retrieving revision 1.316
  diff -u -r1.315 -r1.316
  --- build.xml	23 Aug 2002 00:40:47 -0000	1.315
  +++ build.xml	29 Aug 2002 17:13:33 -0000	1.316
  @@ -1187,6 +1187,7 @@
   
         <patternset refid="needs.jakarta.regexp" />
         <patternset refid="needs.jakarta.oro" />
  +      <patternset refid="needs.jai"/>
   
         <patternset refid="needs.trax" />
         <patternset refid="needs.xslp" />
  @@ -1284,6 +1285,7 @@
             <patternset refid="needs.jdk1.4+" />
             <patternset refid="needs.jakarta.regexp" />
             <patternset refid="needs.jakarta.oro" />
  +          <patternset refid="needs.jai" />
             <patternset refid="needs.vaj" />
             <patternset refid="needs.antlr" />
             <patternset refid="needs.xalan1" />
  
  
  
  1.3       +15 -6     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/image/Image.java
  
  Index: Image.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/image/Image.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Image.java	23 Aug 2002 17:25:46 -0000	1.2
  +++ Image.java	29 Aug 2002 17:13:33 -0000	1.3
  @@ -207,9 +207,6 @@
               }
               input.close();
   
  -
  -            log("Encoding As " + str_encoding);
  -
               if (str_encoding.toLowerCase().equals("jpg")) {
                   str_encoding = "JPEG";
               } else if (str_encoding.toLowerCase().equals("tif")) {
  @@ -225,9 +222,6 @@
               if ((overwrite && new_file.exists()) && (!new_file.equals(file)))
{
                   new_file.delete();
               }
  -            else if (!overwrite && new_file.exists()){
  -              return;
  -            }
   
               FileOutputStream stream = new FileOutputStream(new_file);
   
  @@ -286,6 +280,21 @@
                     filesList.add(new File(fromDir.getAbsolutePath() + File.separator + files[j]));
                   }
               }
  +
  +            if (!overwrite){
  +             // remove any files that shouldn't be overwritten.
  +             ArrayList filesToRemove = new ArrayList();
  +             for(Iterator i = filesList.iterator();i.hasNext();){
  +               File f = (File)i.next();
  +               File new_file = new File(destDir.getAbsolutePath() + File.separator + f.getName());
  +               if (new_file.exists()){
  +                 filesToRemove.add(f);
  +               }
  +             }
  +             filesList.removeAll(filesToRemove);
  +            }
  +
  +
               // iterator through all the files and process them.
               for (Iterator i = filesList.iterator();i.hasNext();){
                 File file = (File)i.next();
  
  
  

--
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