aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/apps/FOUserAgent.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-06-29 12:46:14 +0000
committerJeremias Maerki <jeremias@apache.org>2007-06-29 12:46:14 +0000
commit67a9815afa925606d13e13488e5539a57deb5bb2 (patch)
treeb423af5c05f0dead3721e25f0968cdd53ce4cc55 /src/java/org/apache/fop/apps/FOUserAgent.java
parent8a25e4a1b1ed7100b656913ad311138d54cae943 (diff)
downloadxmlgraphics-fop-67a9815afa925606d13e13488e5539a57deb5bb2.tar.gz
xmlgraphics-fop-67a9815afa925606d13e13488e5539a57deb5bb2.zip
Bugzilla #42278:
Refactoring of color map cache and uri/fo resolution from FopFactory Submitted by: Adrian Cumiskey <fop-dev@cumiskey.com> Changes in addition to the patch by jeremias: - Moved the color map cache to the util package so it doesn't clutter the API (apps) package. - Factored out the data URL resolution into its own URIResolver class which can now be used separately. - Added a utility class for generating RFC2397 data URLs. - Added a unit test for data URL handling. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@551874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/apps/FOUserAgent.java')
-rw-r--r--src/java/org/apache/fop/apps/FOUserAgent.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java
index 24df2f75b..33106ee12 100644
--- a/src/java/org/apache/fop/apps/FOUserAgent.java
+++ b/src/java/org/apache/fop/apps/FOUserAgent.java
@@ -361,26 +361,27 @@ public class FOUserAgent {
* Attempts to resolve the given URI.
* Will use the configured resolver and if not successful fall back
* to the default resolver.
- * @param uri URI to access
+ * @param href URI to access
* @param base the base URI to resolve against
* @return A {@link javax.xml.transform.Source} object, or null if the URI
* cannot be resolved.
* @see org.apache.fop.apps.FOURIResolver
*/
- public Source resolveURI(String uri, String base) {
+ public Source resolveURI(String href, String base) {
Source source = null;
- //RFC 2397 data URLs don't need to be resolved, just decode them.
- boolean bypassURIResolution = uri.startsWith("data:");
+ //RFC 2397 data URLs don't need to be resolved, just decode them through FOP's default
+ //URIResolver.
+ boolean bypassURIResolution = href.startsWith("data:");
if (!bypassURIResolution && uriResolver != null) {
try {
- source = uriResolver.resolve(uri, base);
+ source = uriResolver.resolve(href, base);
} catch (TransformerException te) {
- log.error("Attempt to resolve URI '" + uri + "' failed: ", te);
+ log.error("Attempt to resolve URI '" + href + "' failed: ", te);
}
}
if (source == null) {
// URI Resolver not configured or returned null, use default resolver from the factory
- source = getFactory().resolveURI(uri, base);
+ source = getFactory().resolveURI(href, base);
}
return source;
}