|
|
|
@@ -74,6 +74,7 @@ import javax.xml.transform.sax.SAXSource; |
|
|
|
import org.apache.tools.ant.AntClassLoader; |
|
|
|
import org.apache.tools.ant.BuildException; |
|
|
|
import org.apache.tools.ant.Project; |
|
|
|
import org.apache.tools.ant.taskdefs.condition.Os; |
|
|
|
import org.apache.tools.ant.util.FileUtils; |
|
|
|
import org.apache.tools.ant.util.JAXPUtils; |
|
|
|
import org.xml.sax.EntityResolver; |
|
|
|
@@ -678,6 +679,8 @@ public class XMLCatalog extends DataType |
|
|
|
private InputSource filesystemLookup(ResourceLocation matchingEntry) { |
|
|
|
|
|
|
|
String uri = matchingEntry.getLocation(); |
|
|
|
// the following line seems to be necessary on Windows under JDK 1.2 |
|
|
|
uri = uri.replace(File.separatorChar, '/'); |
|
|
|
URL baseURL = null; |
|
|
|
|
|
|
|
// |
|
|
|
@@ -697,11 +700,25 @@ public class XMLCatalog extends DataType |
|
|
|
|
|
|
|
InputSource source = null; |
|
|
|
URL url = null; |
|
|
|
|
|
|
|
try { |
|
|
|
url = new URL(baseURL, uri); |
|
|
|
} catch (MalformedURLException ex) { |
|
|
|
// ignore |
|
|
|
// this processing is useful under Windows when the location of the DTD has been given as an absolute path |
|
|
|
// see Bugzilla Report 23913 |
|
|
|
File testFile = new File(uri); |
|
|
|
if (testFile.exists() && testFile.canRead()) { |
|
|
|
log("uri : '" |
|
|
|
+ uri + "' matches a readable file", Project.MSG_DEBUG); |
|
|
|
try { |
|
|
|
url = fileUtils.getFileURL(testFile); |
|
|
|
} catch (MalformedURLException ex1) { |
|
|
|
throw new BuildException("could not find an URL for :" + testFile.getAbsolutePath()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
log("uri : '" |
|
|
|
+ uri + "' does not match a readable file", Project.MSG_DEBUG); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (url != null) { |
|
|
|
|