You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/06/09 01:33:09 UTC
cvs commit: xml-xerces/java/src/javax/xml/parsers SAXParser.java
andyc 00/06/08 16:33:08
Modified: java/src/javax/xml/parsers SAXParser.java
Log:
Removed 1.2 call to File#toUrl() to compile under 1.1.
Revision Changes Path
1.3 +13 -2 xml-xerces/java/src/javax/xml/parsers/SAXParser.java
Index: SAXParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/SAXParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SAXParser.java 2000/06/02 23:42:21 1.2
+++ SAXParser.java 2000/06/08 23:33:08 1.3
@@ -101,7 +101,7 @@
*
* @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
* @author Copyright © 2000 The Apache Software Foundation.
- * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/06/02 23:42:21 $
+ * @version 1.0 CVS $Revision: 1.3 $ $Date: 2000/06/08 23:33:08 $
*/
public abstract class SAXParser {
@@ -167,7 +167,18 @@
public void parse(File file, HandlerBase base)
throws SAXException, IOException, IllegalArgumentException {
if (file==null) throw new IllegalArgumentException();
- this.parse(new InputSource(file.toURL().toString()),base);
+ String path = file.getAbsolutePath();
+ if (File.separatorChar != '/') {
+ path = path.replace(File.separatorChar, '/');
+ }
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ if (!path.endsWith("/") && file.isDirectory()) {
+ path = path + "/";
+ }
+ java.net.URL url = new java.net.URL("file", "", path);
+ this.parse(new InputSource(url.toString()),base);
}
/**