keiron 01/06/25 02:00:43
Modified: src/org/apache/fop/image FopImageFactory.java
Log:
compiles on jdk1.1
fixes possible npe when no proptocal specified
Revision Changes Path
1.19 +10 -3 xml-fop/src/org/apache/fop/image/FopImageFactory.java
Index: FopImageFactory.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/FopImageFactory.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- FopImageFactory.java 2001/06/21 14:21:11 1.18
+++ FopImageFactory.java 2001/06/25 09:00:42 1.19
@@ -1,4 +1,4 @@
-/* $Id: FopImageFactory.java,v 1.18 2001/06/21 14:21:11 keiron Exp $
+/* $Id: FopImageFactory.java,v 1.19 2001/06/25 09:00:42 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources."
@@ -43,13 +43,20 @@
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(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]