aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pepping <spepping@apache.org>2011-01-20 16:05:42 +0000
committerSimon Pepping <spepping@apache.org>2011-01-20 16:05:42 +0000
commit03f05c5dc588e40037ce77f742e39fe1eb45cb1e (patch)
tree97e284cf0eabe6ada28f8f79c67962f0cab7d16b
parent5a367c3b12e19af7a66fc923d7149bf22cdfb596 (diff)
downloadxmlgraphics-fop-03f05c5dc588e40037ce77f742e39fe1eb45cb1e.tar.gz
xmlgraphics-fop-03f05c5dc588e40037ce77f742e39fe1eb45cb1e.zip
Avoid deconstructing and reconstructing the base URI of the
configuration; the location string is obtained from a sax.Locator with system ID, line number and optionally column number (avalon.framework.configuration.SAXConfigurationHandler.getLocationString), and can be used as a URI string directly. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1061362 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/apps/FopFactoryConfigurator.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
index 9de00cd85..9097f23e3 100644
--- a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
+++ b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
@@ -378,15 +378,9 @@ public class FopFactoryConfigurator {
private void setBaseURI() throws FOPException {
String loc = cfg.getLocation();
- String[] locationParts = (loc != null ? cfg.getLocation().split(":") : null);
try {
- if (locationParts != null && locationParts.length >= 2
- && "file".equals(locationParts[0])) {
- StringBuilder sb = new StringBuilder(locationParts[1]);
- for (int idx = 2; idx < locationParts.length; idx++) {
- sb.append(":").append(locationParts[idx]);
- }
- baseURI = new URI(locationParts[0], sb.toString(), null);
+ if (loc != null && loc.startsWith("file:")) {
+ baseURI = new URI(loc);
baseURI = baseURI.resolve(".").normalize();
}
if (baseURI == null) {