From 0320691179ed1880c5cedba53059786cadb5b7da Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Tue, 25 Dec 2001 19:54:44 +0000 Subject: [PATCH] setSrc(File) has been replaced with setSrc(SrcFile). No backwards compatibilty issues here as setSrc(File) was introduced Post 1.4.1. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270378 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Unpack.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Unpack.java b/src/main/org/apache/tools/ant/taskdefs/Unpack.java index fd29676be..6c8c65ef0 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Unpack.java +++ b/src/main/org/apache/tools/ant/taskdefs/Unpack.java @@ -58,11 +58,12 @@ package org.apache.tools.ant.taskdefs; 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 Magesh Umasankar + * @author Magesh Umasankar */ public abstract class Unpack extends Task { @@ -72,14 +73,16 @@ public abstract class Unpack extends Task { /** * @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 @@ public abstract class Unpack extends Task { setDest(project.resolveFile(dest)); } - public void setSrc(File src) { - source = src; + public void setSrc(SrcFile srcFile) { + source = srcFile.getFile(); } public void setDest(File dest) { @@ -107,14 +110,6 @@ public abstract class Unpack extends Task { 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) { dest = new File(source.getParent()); }