From 4c06c2bf8629c51dd0c2cacb6e8a8693504d6693 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Tue, 25 Dec 2001 20:07:14 +0000 Subject: [PATCH] setFile(File) has been replaced with setFile(SrcFile). No backwards compatibilty issues here as task was introduced Post 1.4.1. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270379 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Checksum.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Checksum.java b/src/main/org/apache/tools/ant/taskdefs/Checksum.java index 25d4ce396..d8fa4092a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Checksum.java +++ b/src/main/org/apache/tools/ant/taskdefs/Checksum.java @@ -72,12 +72,13 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.condition.Condition; import org.apache.tools.ant.taskdefs.MatchingTask; import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.SrcFile; /** * This task can be used to create checksums for files. * It can also be used to verify checksums. * - * @author Magesh Umasankar + * @author Magesh Umasankar */ public class Checksum extends MatchingTask implements Condition { /** @@ -129,8 +130,8 @@ public class Checksum extends MatchingTask implements Condition { /** * Sets the file for which the checksum is to be calculated. */ - public void setFile(File file) { - this.file = file; + public void setFile(SrcFile file) { + this.file = file.getFile(); } /** @@ -219,11 +220,6 @@ public class Checksum extends MatchingTask implements Condition { "Specify at least one source - a file or a fileset."); } - if (file != null && file.exists() && file.isDirectory()) { - throw new BuildException( - "Checksum cannot be generated for directories"); - } - if (property != null && fileext != null) { throw new BuildException( "Property and FileExt cannot co-exist.");