ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Unpack.java
Date Tue, 25 Dec 2001 19:54:44 GMT
umagesh     01/12/25 11:54:44

  Modified:    src/main/org/apache/tools/ant/taskdefs Unpack.java
  Log:
  setSrc(File) has been replaced with setSrc(SrcFile).  No backwards
  compatibilty issues here as setSrc(File) was introduced Post 1.4.1.
  
  Revision  Changes    Path
  1.3       +9 -14     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Unpack.java
  
  Index: Unpack.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Unpack.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Unpack.java	2001/12/16 02:46:10	1.2
  +++ Unpack.java	2001/12/25 19:54:44	1.3
  @@ -58,11 +58,12 @@
   import java.io.File;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Task;
  +import org.apache.tools.ant.types.SrcFile;
   
   /**
    * Abstract Base class for unpack tasks.
    *
  - * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
  + * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
    */
   
   public abstract class Unpack extends Task {
  @@ -72,14 +73,16 @@
   
       /**
        * @deprecated setSrc(String) is deprecated and is replaced with
  -     *             setSrc(File) to make Ant's Introspection
  +     *             setSrc(SrcFile) to make Ant's Introspection
        *             mechanism do the work and also to encapsulate operations on
        *             the type in its own class.
        */
       public void setSrc(String src) {
           log("DEPRECATED - The setSrc(String) method has been deprecated."
  -            + " Use setSrc(File) instead.");
  -        setSrc(project.resolveFile(src));
  +            + " Use setSrc(SrcFile) instead.");
  +        SrcFile sf = new SrcFile();
  +        sf.setFile(project.resolveFile(src));
  +        setSrc(sf);
       }
   
       /**
  @@ -94,8 +97,8 @@
           setDest(project.resolveFile(dest));
       }
   
  -    public void setSrc(File src) {
  -        source = src;
  +    public void setSrc(SrcFile srcFile) {
  +        source = srcFile.getFile();
       }
   
       public void setDest(File dest) {
  @@ -105,14 +108,6 @@
       private void validate() throws BuildException {
           if (source == null) {
               throw new BuildException("No Src specified", location);
  -        }
  -
  -        if (!source.exists()) {
  -            throw new BuildException("Src doesn't exist", location);
  -        }
  -
  -        if (source.isDirectory()) {
  -            throw new BuildException("Cannot expand a directory", location);
           }
   
           if (dest == null) {
  
  
  

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