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 Sun, 16 Dec 2001 02:46:10 GMT
umagesh     01/12/15 18:46:10

  Modified:    src/main/org/apache/tools/ant/taskdefs Unpack.java
  Log:
  Deprecated setSrc(String) and setDest(String) and added new methods
  setSrc(File) and setDest(File).  Ant;s intrspection will pick up the methods
  that take in File as argument as File gains higher priority over String based
  set* methods.
  This had missed my eyes during my earlier cleanup drive, but it didn't miss
  Peter's ;-)
  
  Revision  Changes    Path
  1.2       +27 -3     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Unpack.java	2001/11/15 09:14:10	1.1
  +++ Unpack.java	2001/12/16 02:46:10	1.2
  @@ -70,17 +70,41 @@
       protected File source;
       protected File dest;
   
  +    /**
  +     * @deprecated setSrc(String) is deprecated and is replaced with
  +     *             setSrc(File) 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) {
  -        source = project.resolveFile(src);
  +        log("DEPRECATED - The setSrc(String) method has been deprecated."
  +            + " Use setSrc(File) instead.");
  +        setSrc(project.resolveFile(src));
       }
   
  +    /**
  +     * @deprecated setDest(String) is deprecated and is replaced with
  +     *             setDest(File) to make Ant's Introspection
  +     *             mechanism do the work and also to encapsulate operations on
  +     *             the type in its own class.
  +     */
       public void setDest(String dest) {
  -        this.dest = project.resolveFile(dest);
  +        log("DEPRECATED - The setDest(String) method has been deprecated."
  +            + " Use setDest(File) instead.");
  +        setDest(project.resolveFile(dest));
       }
   
  +    public void setSrc(File src) {
  +        source = src;
  +    }
  +
  +    public void setDest(File dest) {
  +        this.dest = dest;
  +    }
  +
       private void validate() throws BuildException {
           if (source == null) {
  -            throw new BuildException("No Src for gunzip specified", location);
  +            throw new BuildException("No Src specified", location);
           }
   
           if (!source.exists()) {
  
  
  

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