return systemId;
}
// if id already expanded, return
try {
URI url = new URI(id);
if (url != null) {
return systemId;
}
} catch (Exception e) {
// continue on...
}
// normalize id
id = ResourceResolverSpi.fixURI(id);
// normalize base
URI base = null;
URI url = null;
try {
if (currentSystemId == null) {
String dir;
try {
dir = ResourceResolverSpi.fixURI(System.getProperty("user.dir"));
} catch (SecurityException se) {
dir = "";
}
if (!dir.endsWith("/")) {
dir = dir + "/";
}
final String protocol = "file";
final String host = "";
base = new URI(protocol, host, dir, null, null);
} else {
// should we fix currentSystemId?
currentSystemId = ResourceResolverSpi.fixURI(currentSystemId);
base = new URI(currentSystemId);
}
// expand id
url = new URI(base, id);
} catch (Exception e) {
// let it go through
}
if (url == null) {
return systemId;
}
return url.toString();
}