You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by lb...@apache.org on 2014/07/27 18:23:02 UTC

svn commit: r1613810 - /xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java

Author: lbernardo
Date: Sun Jul 27 16:23:01 2014
New Revision: 1613810

URL: http://svn.apache.org/r1613810
Log:
FOP-2107: org.apache.batik.bridge.BridgeException: Unable to make sense of URL for connection; implemented a better approach.

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java?rev=1613810&r1=1613809&r2=1613810&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/util/ParsedURL.java Sun Jul 27 16:23:01 2014
@@ -532,6 +532,10 @@ public class ParsedURL {
      * @param urlStr the string to parse.
      */
     public static ParsedURLData parseURL(String urlStr) {
+        if (urlStr != null && !urlStr.contains(":") && !urlStr.startsWith("#")) {
+            // an URL needs a protocol; default to file:// if none set
+            urlStr = "file://" + urlStr;
+        }
         ParsedURLProtocolHandler handler = getHandler(getProtocol(urlStr));
         return handler.parseURL(urlStr);
     }