From 2b18ecd15f074e6a6eed02bfa16382cd11f73ad8 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Sun, 16 Dec 2001 02:46:10 +0000 Subject: [PATCH] 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 ;-) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270171 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Unpack.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Unpack.java b/src/main/org/apache/tools/ant/taskdefs/Unpack.java index df2cfad41..fd29676be 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Unpack.java +++ b/src/main/org/apache/tools/ant/taskdefs/Unpack.java @@ -70,17 +70,41 @@ public abstract class Unpack extends Task { 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()) {