]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
initialise driver rather then doing too much in constructor
authorKeiron Liddle <keiron@apache.org>
Thu, 21 Mar 2002 09:31:02 +0000 (09:31 +0000)
committerKeiron Liddle <keiron@apache.org>
Thu, 21 Mar 2002 09:31:02 +0000 (09:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194712 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/apps/CommandLineStarter.java
src/org/apache/fop/apps/Driver.java

index c2d34c3c2cfada450c3f32827bd2e1ed66b13637..77260cadb2b174a45d3d64d7706b457e0682cb95 100644 (file)
@@ -58,6 +58,7 @@ public class CommandLineStarter extends Starter {
         Driver driver = new Driver();
         driver.setLogger(log);
         driver.setBufferFile(commandLineOptions.getBufferFile());
+        driver.initialize();
 
         if (errorDump) {
             driver.setErrorDump(true);
index 3fd180185b2fe7812e4a18b357b350714f77d218..9afb518cca5b1d3939de1e0cf82bda83523a9a76 100644 (file)
@@ -192,9 +192,6 @@ public class Driver {
      */
     public Driver() {
         _stream = null;
-        _treeBuilder = new FOTreeBuilder();
-        _treeBuilder.setUserAgent(getUserAgent());
-        setupDefaultMappings();
     }
 
     public Driver(InputSource source, OutputStream stream) {
@@ -203,6 +200,13 @@ public class Driver {
         _stream = stream;
     }
 
+    public void initialize() {
+        _stream = null;
+        _treeBuilder = new FOTreeBuilder(); 
+        _treeBuilder.setUserAgent(getUserAgent());
+        setupDefaultMappings();
+    }
+
     public void setUserAgent(FOUserAgent agent) {
         userAgent = agent;
     }
@@ -210,7 +214,9 @@ public class Driver {
     private FOUserAgent getUserAgent() {
         if(userAgent == null) {
             userAgent = new FOUserAgent();
-            userAgent.setLogger(log);
+            userAgent.setLogger(getLogger());
+            String base = org.apache.fop.configuration.Configuration.getStringValue("baseDir");
+            userAgent.setBaseURL(base);
         }
         return userAgent;
     }