xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r581806 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java
Date Thu, 04 Oct 2007 09:04:43 GMT
Author: jeremias
Date: Thu Oct  4 02:04:43 2007
New Revision: 581806

URL: http://svn.apache.org/viewvc?rev=581806&view=rev
Log:
Bugzilla #43542:
Removed dependency on Xalan's XML utilities. Used a method from Commons IO instead.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java?rev=581806&r1=581805&r2=581806&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/CachedFontInfo.java Thu Oct  4 02:04:43
2007
@@ -20,10 +20,11 @@
 package org.apache.fop.fonts;
 
 import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.List;
 
-import org.apache.xml.utils.URI;
-import org.apache.xml.utils.URI.MalformedURIException;
+import org.apache.commons.io.FileUtils;
 
 /**
  * Font info stored in the cache 
@@ -45,16 +46,18 @@
         for (int i = 0; i < urls.length; i++) {
             String urlStr = urls[i]; 
             if (urlStr != null) {
+                File fontFile = null;
                 if (urlStr.startsWith("file:")) {
-                    URI uri;
                     try {
-                        uri = new URI(urlStr);
-                        urlStr = uri.getPath();
-                    } catch (MalformedURIException e) {
+                        URL url = new URL(urlStr);
+                        fontFile = FileUtils.toFile(url);
+                    } catch (MalformedURLException mfue) {
                         // do nothing
                     }
                 }
-                File fontFile = new File(urlStr);
+                if (fontFile == null) {
+                    fontFile = new File(urlStr);
+                }
                 if (fontFile.exists() && fontFile.canRead()) {
                     return fontFile;
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message