/** * Returns an Iterator over all the entries */ public Iterator<Entry> iterator() { return getEntries(); }
public static void displayDirectory(DirectoryNode dir, String indent, boolean withSizes) { System.out.println(indent + dir.getName() + " -"); String newIndent = indent + " "; boolean hadChildren = false; for(Iterator<Entry> it = dir.getEntries(); it.hasNext();) { hadChildren = true; Entry entry = it.next(); if (entry instanceof DirectoryNode) { displayDirectory((DirectoryNode) entry, newIndent, withSizes); } else { DocumentNode doc = (DocumentNode) entry; String name = doc.getName(); String size = ""; if (name.charAt(0) < 10) { String altname = "(0x0" + (int) name.charAt(0) + ")" + name.substring(1); name = name.substring(1) + " <" + altname + ">"; } if (withSizes) { size = " [" + doc.getSize() + " / 0x" + Integer.toHexString(doc.getSize()) + "]"; } System.out.println(newIndent + name + size); } } if (!hadChildren) { System.out.println(newIndent + "(no children)"); } } }
/** * Returns an Iterator over all the entries */ public Iterator<Entry> iterator() { return getEntries(); }
/** * Returns an Iterator over all the entries */ public Iterator<Entry> iterator() { return getEntries(); }
/** * Returns an Iterator over all the entries */ public Iterator<Entry> iterator() { return getEntries(); }
POIFSFileSystem poifs = new POIFSFileSystem(fin); DirectoryNode directory = poifs.getRoot(); Iterator<Entry> i = directory.getEntries(); while (i.hasNext()) { Entry e = i.next(); String bookName = e.getName(); if (bookName.equals("Book")) { System.out.println("This is an old format"); } else { System.out.println("This is a new format"); } }
public static void displayDirectory(DirectoryNode dir, String indent, boolean withSizes) { System.out.println(indent + dir.getName() + " -"); String newIndent = indent + " "; boolean hadChildren = false; for(Iterator<Entry> it = dir.getEntries(); it.hasNext();) { hadChildren = true; Entry entry = it.next(); if (entry instanceof DirectoryNode) { displayDirectory((DirectoryNode) entry, newIndent, withSizes); } else { DocumentNode doc = (DocumentNode) entry; String name = doc.getName(); String size = ""; if (name.charAt(0) < 10) { String altname = "(0x0" + (int) name.charAt(0) + ")" + name.substring(1); name = name.substring(1) + " <" + altname + ">"; } if (withSizes) { size = " [" + doc.getSize() + " / 0x" + Integer.toHexString(doc.getSize()) + "]"; } System.out.println(newIndent + name + size); } } if (!hadChildren) { System.out.println(newIndent + "(no children)"); } } }
public static void displayDirectory(DirectoryNode dir, String indent, boolean withSizes) { System.out.println(indent + dir.getName() + " -"); String newIndent = indent + " "; boolean hadChildren = false; for(Iterator<Entry> it = dir.getEntries(); it.hasNext();) { hadChildren = true; Entry entry = it.next(); if (entry instanceof DirectoryNode) { displayDirectory((DirectoryNode) entry, newIndent, withSizes); } else { DocumentNode doc = (DocumentNode) entry; String name = doc.getName(); String size = ""; if (name.charAt(0) < 10) { String altname = "(0x0" + (int) name.charAt(0) + ")" + name.substring(1); name = name.substring(1) + " <" + altname + ">"; } if (withSizes) { size = " [" + doc.getSize() + " / 0x" + Integer.toHexString(doc.getSize()) + "]"; } System.out.println(newIndent + name + size); } } if (!hadChildren) { System.out.println(newIndent + "(no children)"); } } }
public static void displayDirectory(DirectoryNode dir, String indent, boolean withSizes) { System.out.println(indent + dir.getName() + " -"); String newIndent = indent + " "; boolean hadChildren = false; for(Iterator<Entry> it = dir.getEntries(); it.hasNext();) { hadChildren = true; Entry entry = it.next(); if (entry instanceof DirectoryNode) { displayDirectory((DirectoryNode) entry, newIndent, withSizes); } else { DocumentNode doc = (DocumentNode) entry; String name = doc.getName(); String size = ""; if (name.charAt(0) < 10) { String altname = "(0x0" + (int) name.charAt(0) + ")" + name.substring(1); name = name.substring(1) + " <" + altname + ">"; } if (withSizes) { size = " [" + doc.getSize() + " / 0x" + Integer.toHexString(doc.getSize()) + "]"; } System.out.println(newIndent + name + size); } } if (!hadChildren) { System.out.println(newIndent + "(no children)"); } } }
for(Iterator<Entry> entries = poifsDir.getEntries(); entries.hasNext(); ) {
for (Iterator<Entry> entries = poifsDir.getEntries(); entries.hasNext();) { Entry entry = entries.next();
boolean tableWritten = false; boolean propertiesWritten = false; for ( Iterator<Entry> iter = directory.getEntries(); iter.hasNext(); )