aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/cli/CommandLineOptions.java
diff options
context:
space:
mode:
authorMehdi Houshmand <mehdi@apache.org>2012-07-06 11:18:04 +0000
committerMehdi Houshmand <mehdi@apache.org>2012-07-06 11:18:04 +0000
commitd54c3555e03f41f6e8559a4c842e7a106347751a (patch)
tree1f071cba35154867dfee824eb9d2c71745c3f73f /src/java/org/apache/fop/cli/CommandLineOptions.java
parent6405d862d3c5bb4427ed1fee0c38f18e0d245271 (diff)
downloadxmlgraphics-fop-d54c3555e03f41f6e8559a4c842e7a106347751a.tar.gz
xmlgraphics-fop-d54c3555e03f41f6e8559a4c842e7a106347751a.zip
Fixed NPE with when outputting AreaTree also improved base URI handling for CLI
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1358130 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/cli/CommandLineOptions.java')
-rw-r--r--src/java/org/apache/fop/cli/CommandLineOptions.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java
index 5c561f9a5..313201abd 100644
--- a/src/java/org/apache/fop/cli/CommandLineOptions.java
+++ b/src/java/org/apache/fop/cli/CommandLineOptions.java
@@ -24,6 +24,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
+import java.net.URI;
import java.util.Locale;
import java.util.Map;
import java.util.Vector;
@@ -137,6 +138,8 @@ public class CommandLineOptions {
private boolean flushCache = false;
+ private URI baseURI = new File(".").toURI();
+
/**
* Construct a command line option object.
*/
@@ -465,6 +468,7 @@ public class CommandLineOptions {
this.useStdIn = true;
} else {
fofile = new File(filename);
+ baseURI = fofile.toURI();
}
return 1;
}
@@ -494,6 +498,7 @@ public class CommandLineOptions {
this.useStdIn = true;
} else {
xmlfile = new File(filename);
+ baseURI = xmlfile.toURI();
}
return 1;
}
@@ -783,6 +788,7 @@ public class CommandLineOptions {
this.useStdIn = true;
} else {
areatreefile = new File(filename);
+ baseURI = areatreefile.toURI();
}
return 1;
}
@@ -799,6 +805,7 @@ public class CommandLineOptions {
this.useStdIn = true;
} else {
iffile = new File(filename);
+ baseURI = iffile.toURI();
}
return 1;
}
@@ -815,6 +822,7 @@ public class CommandLineOptions {
this.useStdIn = true;
} else {
imagefile = new File(filename);
+ baseURI = imagefile.toURI();
}
return 1;
}
@@ -1030,7 +1038,7 @@ public class CommandLineOptions {
private void setUserConfig() throws FOPException, IOException {
FopFactoryBuilder fopFactoryBuilder;
if (userConfigFile == null) {
- fopFactoryBuilder = new FopFactoryBuilder(fofile.toURI());
+ fopFactoryBuilder = new FopFactoryBuilder(baseURI);
fopFactoryBuilder.setStrictFOValidation(strictValidation);
fopFactoryBuilder.setTargetResolution(targetResolution);
fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures);