diff options
author | Finn Bock <bckfnn@apache.org> | 2004-09-13 07:08:49 +0000 |
---|---|---|
committer | Finn Bock <bckfnn@apache.org> | 2004-09-13 07:08:49 +0000 |
commit | d6603609537ed8e97af8e34acdde4dca8381c419 (patch) | |
tree | 73e4241af262b9b85b18e8b0b2529e6ca11475ed /src/java/org/apache/fop/apps | |
parent | 5fee7bd957ac85640ed4851bece1216eb6c6d5a5 (diff) | |
download | xmlgraphics-fop-d6603609537ed8e97af8e34acdde4dca8381c419.tar.gz xmlgraphics-fop-d6603609537ed8e97af8e34acdde4dca8381c419.zip |
Avoid throwing exceptions from ctor, the logger is lost in that case.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197946 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/apps')
-rw-r--r-- | src/java/org/apache/fop/apps/CommandLineOptions.java | 19 | ||||
-rw-r--r-- | src/java/org/apache/fop/apps/Fop.java | 3 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/apps/CommandLineOptions.java b/src/java/org/apache/fop/apps/CommandLineOptions.java index a2e8ebd9e..e344078ff 100644 --- a/src/java/org/apache/fop/apps/CommandLineOptions.java +++ b/src/java/org/apache/fop/apps/CommandLineOptions.java @@ -72,13 +72,9 @@ public class CommandLineOptions implements Constants { private Vector xsltParams = null; /** - * Construct a command line option object from command line arguments - * @param args command line parameters - * @throws FOPException for general errors - * @throws FileNotFoundException if an input file wasn't found - * @throws IOException if the the configuration file could not be loaded + * Construct a command line option object. */ - public CommandLineOptions(String[] args) throws FOPException, IOException { + public CommandLineOptions() { LogFactory logFactory = LogFactory.getFactory(); // Enable the simple command line logging when no other logger is @@ -90,11 +86,16 @@ public class CommandLineOptions implements Constants { } log = LogFactory.getLog("FOP"); - - parse(args); } - private void parse(String[] args) + /** + * Parse the command line arguments. + * @param args the command line arguments. + * @throws FOPException for general errors + * @throws FileNotFoundException if an input file wasn't found + * @throws IOException if the the configuration file could not be loaded + */ + public void parse(String[] args) throws FOPException, IOException { boolean optionsParsed = true; diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java index b9b52ec43..90fb83d39 100644 --- a/src/java/org/apache/fop/apps/Fop.java +++ b/src/java/org/apache/fop/apps/Fop.java @@ -138,7 +138,8 @@ public class Fop implements Constants { BufferedOutputStream bos = null; try { - options = new CommandLineOptions(args); + options = new CommandLineOptions(); + options.parse(args); foUserAgent = options.getFOUserAgent(); Fop fop = new Fop(options.getRenderer(), foUserAgent); |