From c9929932a29d5fbc685be05b3fcf220b7d7478d6 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Sat, 25 Jul 2009 10:21:28 +0000 Subject: [PATCH] added a cmd option to turn on deserialization of escher records git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@797735 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/dev/BiffViewer.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/java/org/apache/poi/hssf/dev/BiffViewer.java b/src/java/org/apache/poi/hssf/dev/BiffViewer.java index 264aa6d7f..ff708b5d1 100644 --- a/src/java/org/apache/poi/hssf/dev/BiffViewer.java +++ b/src/java/org/apache/poi/hssf/dev/BiffViewer.java @@ -48,7 +48,7 @@ import org.apache.poi.util.LittleEndian; public final class BiffViewer { static final char[] NEW_LINE_CHARS = System.getProperty("line.separator").toCharArray(); - private BiffViewer() { + private BiffViewer() { // no instances of this class } @@ -294,8 +294,10 @@ public final class BiffViewer { noint = true; } else if ("--out".equals(arg)) { out = true; - } else if ("--rawhex".equals(arg)) { - rawhex = true; + } else if ("--escher".equals(arg)) { + System.setProperty("poi.deserialize.escher", "true"); + } else if ("--rawhex".equals(arg)) { + rawhex = true; } else { throw new CommandParseException("Unexpected option '" + arg + "'"); } @@ -342,7 +344,7 @@ public final class BiffViewer { * * Usage:
* - * BiffViewer [--biffhex] [--noint] [--out] <fileName>
+ * BiffViewer [--biffhex] [--noint] [--noescher] [--out] <fileName>
* BiffViewer --rawhex [--out] <fileName>
*
* @@ -351,11 +353,9 @@ public final class BiffViewer { * --nointdo not output interpretation of BIFF records * --outsend output to <fileName>.out * --rawhexoutput raw hex dump of whole workbook stream + * --escherturn on deserialization of escher records (default is off) * * - * Define the system property poi.deserialize.escher to turn on - * deserialization of escher records. - * */ public static void main(String[] args) { @@ -367,9 +367,6 @@ public final class BiffViewer { return; } - System.setProperty("poi.deserialize.escher", "true"); - - try { PrintStream ps;