Print mini stream information, and property entries

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1688037 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-06-28 18:51:50 +00:00
parent 799e53d039
commit 5c5bafacd2
1 changed files with 12 additions and 5 deletions

View File

@ -159,21 +159,28 @@ public class POIFSHeaderDumper {
} }
public static void displayPropertiesSummary(PropertyTable properties) { public static void displayPropertiesSummary(PropertyTable properties) {
System.out.println("Mini Stream starts at " + properties.getRoot().getStartBlock());
System.out.println();
System.out.println("Properties and their block start:"); System.out.println("Properties and their block start:");
displayProperties(properties.getRoot(), ""); displayProperties(properties.getRoot(), "");
System.out.println(""); System.out.println("");
} }
public static void displayProperties(DirectoryProperty prop, String indent) { public static void displayProperties(DirectoryProperty prop, String indent) {
indent = indent + " "; String nextIndent = indent + " ";
System.out.println(prop.getName()); System.out.println(indent + "-> " + prop.getName());
for (Property cp : prop) { for (Property cp : prop) {
if (cp instanceof DirectoryProperty) { if (cp instanceof DirectoryProperty) {
displayProperties((DirectoryProperty)cp, indent); displayProperties((DirectoryProperty)cp, nextIndent);
} else { } else {
// TODO System.out.println(nextIndent + "=> " + cp.getName());
System.out.print(nextIndent + " " + cp.getSize() + " bytes in ");
if (cp.shouldUseSmallBlocks()) { if (cp.shouldUseSmallBlocks()) {
System.out.print("mini");
} } else {
System.out.print("main");
}
System.out.println(" stream, starts at " + cp.getStartBlock());
} }
} }
} }