From a41723ab30aa5c6a234b0480b5613eec9f7f94b0 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 28 Jul 2000 09:30:31 +0000 Subject: [PATCH] Available didn't resolve filenames correctly. Reported by: Marc Gemis git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267847 13f79535-47bb-0310-9956-ffa450edef68 --- docs/index.html | 3 +++ .../org/apache/tools/ant/taskdefs/Available.java | 16 +++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/index.html b/docs/index.html index d6b0ecbd1..3c3bc157a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -108,6 +108,9 @@ build Ant from the source code.

Building Ant

Go to the directory jakarta-ant.

Make sure the JDK is in you path.

+

Set the JAVA_HOME environment variable. This should be set to the +directory where the JDK is installed. See Installing Ant +for examples on how to do this for your operating system.

Run bootstrap.bat (Windows) or bootstrap.sh (UNIX) to build a bootstrap version of Ant.

When finished, use

diff --git a/src/main/org/apache/tools/ant/taskdefs/Available.java b/src/main/org/apache/tools/ant/taskdefs/Available.java index 5bd0ac778..d2646245d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Available.java +++ b/src/main/org/apache/tools/ant/taskdefs/Available.java @@ -68,7 +68,7 @@ public class Available extends Task { private String property; private String classname; - private String file; + private File file; private String resource; public void setProperty(String property) { @@ -86,8 +86,8 @@ public class Available extends Task { this.classname = classname; } - public void setFile(String filename) { - this.file = filename; + public void setFile(File file) { + this.file = file; } public void setResource(String resource) { @@ -102,14 +102,8 @@ public class Available extends Task { this.project.setProperty(property, "true"); } - private boolean checkFile(String file) { - try { - File f = new File(file); - return f.exists(); - } catch (Exception e) { - log(e.toString(), Project.MSG_VERBOSE); - return false; - } + private boolean checkFile(File file) { + return file.exists(); } private boolean checkResource(String resource) {