bodewig 00/07/28 04:00:31
Modified: src/main/org/apache/tools/ant/taskdefs Property.java
Log:
<property file="..."> didn't resolve relative filenames correctly.
Reported by: Marc Gemis <[EMAIL PROTECTED]>
Revision Changes Path
1.11 +8 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Property.java 2000/07/23 15:32:58 1.10
+++ Property.java 2000/07/28 11:00:30 1.11
@@ -70,7 +70,7 @@
String name;
String value;
- String file;
+ File file;
String resource;
boolean userProperty=false; // set read-only properties
@@ -91,11 +91,11 @@
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 @@
}
}
- 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);