aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-06-25 09:00:42 +0000
committerKeiron Liddle <keiron@apache.org>2001-06-25 09:00:42 +0000
commit63b17d789dc008a7b3e64300d0ca13d11a396354 (patch)
tree910c947ea104b44a9b71c4e0eab7bb330a6e0cbe /src/org/apache/fop
parent758c89f89e3d2ef88b8c5c76aae41f7e8ecbb26a (diff)
downloadxmlgraphics-fop-63b17d789dc008a7b3e64300d0ca13d11a396354.tar.gz
xmlgraphics-fop-63b17d789dc008a7b3e64300d0ca13d11a396354.zip
compiles on jdk1.1
fixes possible npe when no proptocal specified git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194314 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop')
-rw-r--r--src/org/apache/fop/image/FopImageFactory.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/apache/fop/image/FopImageFactory.java b/src/org/apache/fop/image/FopImageFactory.java
index 95dee4285..25bf4551a 100644
--- a/src/org/apache/fop/image/FopImageFactory.java
+++ b/src/org/apache/fop/image/FopImageFactory.java
@@ -43,13 +43,20 @@ public class FopImageFactory {
URL absoluteURL = null;
InputStream imgIS = null;
try {
- absoluteURL = new URL(href);
+ try {
+ absoluteURL = new URL(href);
+ } catch (MalformedURLException mue) {
+ // if the href contains onl a path then file is assumed
+ absoluteURL = new URL("file:" + href);
+ }
imgIS = absoluteURL.openStream();
+ } catch (MalformedURLException e_context) {
+ throw new FopImageException("Error with image URL: " + e_context.getMessage());
} catch (Exception e) {
// maybe relative
URL context_url = null;
try {
- absoluteURL = new URL(Configuration.getStringValue("baseDir") + absoluteURL.getPath());
+ absoluteURL = new URL(Configuration.getStringValue("baseDir") + absoluteURL.getFile());
} catch (MalformedURLException e_context) {
// pb context url
throw new FopImageException(