Fix bug with file: URLs getting too many slashes (file:////) which caused confusion
git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225978 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c459bfa25
commit
3d9241dce9
@ -749,7 +749,7 @@ public class Catalog {
|
|||||||
try {
|
try {
|
||||||
// tack on a basename because URLs point to files not dirs
|
// tack on a basename because URLs point to files not dirs
|
||||||
String userdir = fixSlashes(System.getProperty("user.dir"));
|
String userdir = fixSlashes(System.getProperty("user.dir"));
|
||||||
catalogCwd = new URL("file:///" + userdir + "/basename");
|
catalogCwd = new URL("file:" + userdir + "/basename");
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
String userdir = fixSlashes(System.getProperty("user.dir"));
|
String userdir = fixSlashes(System.getProperty("user.dir"));
|
||||||
Debug.message(1, "Malformed URL on cwd", userdir);
|
Debug.message(1, "Malformed URL on cwd", userdir);
|
||||||
@ -761,7 +761,7 @@ public class Catalog {
|
|||||||
base = new URL(catalogCwd, fixSlashes(fileName));
|
base = new URL(catalogCwd, fixSlashes(fileName));
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
try {
|
try {
|
||||||
base = new URL("file:///" + fixSlashes(fileName));
|
base = new URL("file:" + fixSlashes(fileName));
|
||||||
} catch (MalformedURLException e2) {
|
} catch (MalformedURLException e2) {
|
||||||
Debug.message(1, "Malformed URL on catalog filename",
|
Debug.message(1, "Malformed URL on catalog filename",
|
||||||
fixSlashes(fileName));
|
fixSlashes(fileName));
|
||||||
@ -843,7 +843,7 @@ public class Catalog {
|
|||||||
newbase = new URL(base, value);
|
newbase = new URL(base, value);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
try {
|
try {
|
||||||
newbase = new URL("file:///" + value);
|
newbase = new URL("file:" + value);
|
||||||
} catch (MalformedURLException e2) {
|
} catch (MalformedURLException e2) {
|
||||||
Debug.message(1, "Malformed URL on base", value);
|
Debug.message(1, "Malformed URL on base", value);
|
||||||
newbase = null;
|
newbase = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user