From e868ebf02fbf9bfabcd532071a750c23bab46bd3 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 28 Jul 2000 11:00:30 +0000 Subject: [PATCH] didn't resolve relative filenames correctly. Reported by: Marc Gemis git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267848 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Property.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Property.java b/src/main/org/apache/tools/ant/taskdefs/Property.java index b3759dc84..fdfa451d7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Property.java +++ b/src/main/org/apache/tools/ant/taskdefs/Property.java @@ -70,7 +70,7 @@ public class Property extends Task { String name; String value; - String file; + File file; String resource; boolean userProperty=false; // set read-only properties @@ -91,11 +91,11 @@ public class Property extends Task { return value; } - public void setFile(String file) { + public void setFile(File file) { this.file = file; } - public String getFile() { + public File getFile() { return file; } @@ -122,15 +122,16 @@ public class Property extends Task { } } - private void loadFile (String name) throws BuildException { + private void loadFile (File file) throws BuildException { Properties props = new Properties(); log("Loading " + name, Project.MSG_VERBOSE); try { - if (new File(name).exists()) { - props.load(new FileInputStream(name)); + if (file.exists()) { + props.load(new FileInputStream(file)); addProperties(props); } else { - log("Unable to find " + name, Project.MSG_VERBOSE); + log("Unable to find " + file.getAbsolutePath(), + Project.MSG_VERBOSE); } } catch(Exception ex) { throw new BuildException(ex.getMessage(), ex, location);