Browse Source

Available didn't resolve filenames correctly.

Reported by:	Marc Gemis <marc.gemis.mg@belgium.agfa.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267847 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
a41723ab30
2 changed files with 8 additions and 11 deletions
  1. +3
    -0
      docs/index.html
  2. +5
    -11
      src/main/org/apache/tools/ant/taskdefs/Available.java

+ 3
- 0
docs/index.html View File

@@ -108,6 +108,9 @@ build Ant from the source code.</p>
<h2><a name="buildingant">Building Ant</a></h2> <h2><a name="buildingant">Building Ant</a></h2>
<p>Go to the directory <code>jakarta-ant</code>.</p> <p>Go to the directory <code>jakarta-ant</code>.</p>
<p>Make sure the JDK is in you path.</p> <p>Make sure the JDK is in you path.</p>
<p>Set the JAVA_HOME environment variable. This should be set to the
directory where the JDK is installed. See <a href="#installing">Installing Ant</a>
for examples on how to do this for your operating system.</p>
<p>Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX) <p>Run <code>bootstrap.bat</code> (Windows) or <code>bootstrap.sh</code> (UNIX)
to build a bootstrap version of Ant.</p> to build a bootstrap version of Ant.</p>
<p>When finished, use</p> <p>When finished, use</p>


+ 5
- 11
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -68,7 +68,7 @@ public class Available extends Task {


private String property; private String property;
private String classname; private String classname;
private String file;
private File file;
private String resource; private String resource;


public void setProperty(String property) { public void setProperty(String property) {
@@ -86,8 +86,8 @@ public class Available extends Task {
this.classname = classname; this.classname = classname;
} }


public void setFile(String filename) {
this.file = filename;
public void setFile(File file) {
this.file = file;
} }


public void setResource(String resource) { public void setResource(String resource) {
@@ -102,14 +102,8 @@ public class Available extends Task {
this.project.setProperty(property, "true"); 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) { private boolean checkResource(String resource) {


Loading…
Cancel
Save