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
This commit is contained in:
Yegor Kozlov 2009-07-25 10:21:28 +00:00
parent 389ba18274
commit c9929932a2

View File

@ -48,7 +48,7 @@ import org.apache.poi.util.LittleEndian;
public final class BiffViewer { public final class BiffViewer {
static final char[] NEW_LINE_CHARS = System.getProperty("line.separator").toCharArray(); static final char[] NEW_LINE_CHARS = System.getProperty("line.separator").toCharArray();
private BiffViewer() { private BiffViewer() {
// no instances of this class // no instances of this class
} }
@ -294,8 +294,10 @@ public final class BiffViewer {
noint = true; noint = true;
} else if ("--out".equals(arg)) { } else if ("--out".equals(arg)) {
out = true; out = true;
} else if ("--rawhex".equals(arg)) { } else if ("--escher".equals(arg)) {
rawhex = true; System.setProperty("poi.deserialize.escher", "true");
} else if ("--rawhex".equals(arg)) {
rawhex = true;
} else { } else {
throw new CommandParseException("Unexpected option '" + arg + "'"); throw new CommandParseException("Unexpected option '" + arg + "'");
} }
@ -342,7 +344,7 @@ public final class BiffViewer {
* *
* <b>Usage</b>:<br/> * <b>Usage</b>:<br/>
* *
* BiffViewer [--biffhex] [--noint] [--out] &lt;fileName&gt; <br/> * BiffViewer [--biffhex] [--noint] [--noescher] [--out] &lt;fileName&gt; <br/>
* BiffViewer --rawhex [--out] &lt;fileName&gt; <br/> * BiffViewer --rawhex [--out] &lt;fileName&gt; <br/>
* <br/> * <br/>
* *
@ -351,11 +353,9 @@ public final class BiffViewer {
* <tr><td>--noint</td><td>do not output interpretation of BIFF records</td></tr> * <tr><td>--noint</td><td>do not output interpretation of BIFF records</td></tr>
* <tr><td>--out</td><td>send output to &lt;fileName&gt;.out</td></tr> * <tr><td>--out</td><td>send output to &lt;fileName&gt;.out</td></tr>
* <tr><td>--rawhex</td><td>output raw hex dump of whole workbook stream</td></tr> * <tr><td>--rawhex</td><td>output raw hex dump of whole workbook stream</td></tr>
* <tr><td>--escher</td><td>turn on deserialization of escher records (default is off)</td></tr>
* </table> * </table>
* *
* Define the system property <code>poi.deserialize.escher</code> to turn on
* deserialization of escher records.
*
*/ */
public static void main(String[] args) { public static void main(String[] args) {
@ -367,9 +367,6 @@ public final class BiffViewer {
return; return;
} }
System.setProperty("poi.deserialize.escher", "true");
try { try {
PrintStream ps; PrintStream ps;