peterreilly 2003/10/31 08:09:22 Modified: src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH ImportTask.java Log: sync with HEAD Revision Changes Path No revision No revision 1.16.2.2 +3 -6 ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java Index: ImportTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -r1.16.2.1 -r1.16.2.2 --- ImportTask.java 16 Oct 2003 17:04:57 -0000 1.16.2.1 +++ ImportTask.java 31 Oct 2003 16:09:22 -0000 1.16.2.2 @@ -58,6 +58,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Task; +import org.apache.tools.ant.util.FileUtils; import java.io.File; import java.io.IOException; @@ -95,6 +96,7 @@ public class ImportTask extends Task { private String file; private boolean optional; + private static final FileUtils FILE_UTILS = FileUtils.newFileUtils(); /** * sets the optional attribute @@ -147,17 +149,12 @@ File buildFile = new File(getLocation().getFileName()); buildFile = new File(buildFile.getAbsolutePath()); - File buildFileParent = new File(buildFile.getParent()); - getProject().log("Importing file " + file + " from " + buildFile.getAbsolutePath(), Project.MSG_VERBOSE); // Paths are relative to the build file they're imported from, // *not* the current directory (same as entity includes). - File importedFile = new File(file); - if (!importedFile.isAbsolute()) { - importedFile = new File(buildFileParent, file); - } + File importedFile = FILE_UTILS.resolveFile(buildFile, file); if (!importedFile.exists()) { String message =
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]