Browse Source

Handle directories with # in them by passing the parser

an inputstream, rather than a name.

Submitted by:	Yossie Teitz <yossie@reachcast.co.il>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268462 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
6500a507bb
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      src/main/org/apache/tools/ant/ProjectHelper.java

+ 15
- 1
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -98,10 +98,14 @@ public class ProjectHelper {
* Parses the project file.
*/
private void parse() throws BuildException {
FileInputStream inputStream = null;
try {
SAXParser saxParser = getParserFactory().newSAXParser();
parser = saxParser.getParser();
saxParser.parse(buildFile, new RootHandler());
inputStream = new FileInputStream(buildFile);
saxParser.parse(inputStream, new RootHandler());
}
catch(ParserConfigurationException exc) {
throw new BuildException("Parser has not been configured correctly", exc);
@@ -134,6 +138,16 @@ public class ProjectHelper {
catch(IOException exc) {
throw new BuildException("Error reading project file", exc);
}
finally {
if (inputStream != null) {
try {
inputStream.close();
}
catch (IOException ioe) {
// ignore this
}
}
}
}

/**


Loading…
Cancel
Save