Index: Available.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
retrieving revision 1.20
diff -u -r1.20 Available.java
--- Available.java	2001/05/03 07:41:08	1.20
+++ Available.java	2001/06/05 10:40:59
@@ -70,6 +70,7 @@
     private String property;
     private String classname;
     private File file;
+    private Path filepath;
     private String resource;
     private String type;
     private Path classpath;
@@ -95,6 +96,14 @@
         createClasspath().setRefid(r);
     }
 
+    public void setFilepath(Path filepath) {
+        if (this.filepath == null) {
+            this.filepath = filepath;
+        } else {
+            this.filepath.append(filepath);
+        }
+    }
+    
     public void setProperty(String property) {
         this.property = property;
     }
@@ -160,10 +169,20 @@
 
     private boolean checkFile(File file) {
         if (type != null) {
-            if (type.equalsIgnoreCase("dir")){
+            if (type.equalsIgnoreCase("dir")) {
                 return file.isDirectory();
-            } else if (type.equalsIgnoreCase("file")){
-                return file.isFile();
+            } else if (type.equalsIgnoreCase("file")) {
+                if (filepath == null) {
+                    return file.isFile();
+                } else {
+                    String[] paths = filepath.list();
+                    for(int i = 0; i < paths.length; ++i) {
+                        log("Searching " + paths[i], Project.MSG_VERBOSE);
+                        if(new File(paths[i], file.getName()).isFile()) {
+                            return true;
+                        }
+                    }
+                }
             }
         }
         return file.exists();
