You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/10/02 20:06:09 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLEntityManager.java
sandygao 2002/10/02 11:06:09
Modified: java/src/org/apache/xerces/impl XMLEntityManager.java
Log:
1. Shouldn't prepend "file://" to the user dir, because later on when a URI
is created, another "file://" will be prepended.
2. Avoid creating a new Sting to change "blah/blah" to "blah/blah/", now
we do it when we still have the string buffer.
Revision Changes Path
1.49 +6 -9 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- XMLEntityManager.java 29 Sep 2002 04:25:39 -0000 1.48
+++ XMLEntityManager.java 2 Oct 2002 18:06:08 -0000 1.49
@@ -1290,7 +1290,6 @@
int len = userDir.length(), ch;
StringBuffer buffer = new StringBuffer(len*3);
- buffer.append("file://");
// change C:/blah to /C:/blah
if (len >= 2 && userDir.charAt(1) == ':') {
ch = Character.toUpperCase(userDir.charAt(0));
@@ -1351,6 +1350,10 @@
}
}
+ // change blah/blah to blah/blah/
+ if (!userDir.endsWith("/"))
+ buffer.append('/');
+
gEscapedUserDir = buffer.toString();
return gEscapedUserDir;
@@ -1395,9 +1398,6 @@
if (baseSystemId == null || baseSystemId.length() == 0 ||
baseSystemId.equals(systemId)) {
String dir = getUserDir();
- if (!dir.endsWith("/")) {
- dir = dir + "/";
- }
base = new URI("file", "", dir, null, null);
}
else {
@@ -1405,16 +1405,13 @@
base = new URI(fixURI(baseSystemId));
}
catch (URI.MalformedURIException e) {
- String dir = getUserDir();
if (baseSystemId.indexOf(':') != -1) {
// for xml schemas we might have baseURI with
// a specified drive
base = new URI("file", "", fixURI(baseSystemId), null, null);
}
else {
- if (!dir.endsWith("/")) {
- dir = dir + "/";
- }
+ String dir = getUserDir();
dir = dir + fixURI(baseSystemId);
base = new URI("file", "", dir, null, null);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org