diff options
Diffstat (limited to 'src')
4 files changed, 14 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java index 9f5cebf8e..0d604f48c 100644 --- a/src/java/org/apache/fop/apps/FOURIResolver.java +++ b/src/java/org/apache/fop/apps/FOURIResolver.java @@ -204,7 +204,7 @@ public class FOURIResolver ? new java.io.File("").toURL().toExternalForm() : baseURL); } catch (MalformedURLException mfue) { - log.error("Error with base URL: " + mfue.getMessage(), mfue); + log.error("Error with base URL \"" + baseURL + "\"): " + mfue.getMessage()); } return null; } diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index c03d904ff..e7686e65f 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -462,9 +462,6 @@ public class FOUserAgent { File dir = new File(cfgBaseDir); if (dir.isDirectory()) { cfgBaseDir = dir.toURL().toExternalForm(); - } else { - //The next statement is for validation only - new URL(cfgBaseDir); } } log.info(name + " set to: " + cfgBaseDir); diff --git a/src/java/org/apache/fop/fonts/LazyFont.java b/src/java/org/apache/fop/fonts/LazyFont.java index ee0b47ec3..c08216ab0 100644 --- a/src/java/org/apache/fop/fonts/LazyFont.java +++ b/src/java/org/apache/fop/fonts/LazyFont.java @@ -95,7 +95,9 @@ public class LazyFont extends Typeface implements FontDescriptor { } return; } - reader = new FontReader(new InputSource(in)); + InputSource src = new InputSource(in); + src.setSystemId(source.getSystemId()); + reader = new FontReader(src); } else { reader = new FontReader(new InputSource(new URL(metricsFileName).openStream())); diff --git a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java index ae8b4eba4..e442b7662 100644 --- a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java +++ b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java @@ -52,7 +52,13 @@ public class ServletContextURIResolver implements URIResolver { if (href.startsWith(SERVLET_CONTEXT_PROTOCOL)) { return resolveServletContextURI(href.substring(SERVLET_CONTEXT_PROTOCOL.length())); } else { - return null; + if (base.startsWith(SERVLET_CONTEXT_PROTOCOL) && (href.indexOf(':') < 0)) { + String abs = base + href; + return resolveServletContextURI( + abs.substring(SERVLET_CONTEXT_PROTOCOL.length())); + } else { + return null; + } } } @@ -63,6 +69,9 @@ public class ServletContextURIResolver implements URIResolver { * @throws TransformerException if no URL can be constructed from the path */ protected Source resolveServletContextURI(String path) throws TransformerException { + while (path.startsWith("//")) { + path = path.substring(1); + } try { URL url = this.servletContext.getResource(path); InputStream in = this.servletContext.getResourceAsStream(path); |