Browse Source

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
master
Magesh Umasankar 23 years ago
parent
commit
2b18ecd15f
1 changed files with 27 additions and 3 deletions
  1. +27
    -3
      src/main/org/apache/tools/ant/taskdefs/Unpack.java

+ 27
- 3
src/main/org/apache/tools/ant/taskdefs/Unpack.java View File

@@ -70,17 +70,41 @@ public abstract class Unpack extends Task {
protected File source; protected File source;
protected File dest; 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) { 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) { 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 { private void validate() throws BuildException {
if (source == null) { if (source == null) {
throw new BuildException("No Src for gunzip specified", location);
throw new BuildException("No Src specified", location);
} }


if (!source.exists()) { if (!source.exists()) {


Loading…
Cancel
Save