You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2015/08/07 15:11:43 UTC

svn commit: r1694682 - /xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext

Author: ssteiner
Date: Fri Aug  7 13:11:43 2015
New Revision: 1694682

URL: http://svn.apache.org/r1694682
Log:
API changed, patch from Athanasios Giannimaras 

Modified:
    xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext

Modified: xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext
URL: http://svn.apache.org/viewvc/xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext?rev=1694682&r1=1694681&r2=1694682&view=diff
==============================================================================
--- xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext (original)
+++ xmlgraphics/site/trunk/content/fop/trunk/servlets.mdtext Fri Aug  7 13:11:43 2015
@@ -150,10 +150,21 @@ Here are some example snippets:
     this.transFactory.setURIResolver(this.uriResolver);
 
     [..]
+    
+     ResourceResolver resolver = new ResourceResolver() {
+            public OutputStream getOutputStream(URI uri) throws IOException {
+                URL url = getServletContext().getResource(uri.toASCIIString());
+                return url.openConnection().getOutputStream();
+            }
 
+            public Resource getResource(URI uri) throws IOException {
+                return new Resource(getServletContext().getResourceAsStream(uri.toASCIIString()));
+            }
+        };
+    
     //Setting up the FOP factory
-    this.fopFactory = FopFactory.newInstance(new File(".").toURI());
-    this.fopFactory.setURIResolver(this.uriResolver);
+    FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI(), resolver);
+    fopFactory = builder.build();
 
     [..]
 



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