Package org.apache.poi.poifs.filesystem

Examples of org.apache.poi.poifs.filesystem.DocumentNode


     */
    private static MediaType processCompObjFormatType(DirectoryEntry root) {
        try {
            Entry e = root.getEntry("\u0001CompObj");
            if (e != null && e.isDocumentEntry()) {
                DocumentNode dn = (DocumentNode)e;
                DocumentInputStream stream = new DocumentInputStream(dn);
                byte [] bytes = IOUtils.toByteArray(stream);
                /*
                 * This array contains a string with a normal ASCII name of the
                 * application used to create this file. We want to search for that
View Full Code Here


           hadChildren = true;
           Entry entry = it.next();
           if (entry instanceof DirectoryNode) {
              displayDirectory((DirectoryNode) entry, os, 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()) + "]";
              }
              os.write((newIndent + name + size + "\n").getBytes() );
           }
        }
        if (!hadChildren) {
View Full Code Here

    @Test
    public void inPlaceNPOIFSWrite() throws Exception {
        try {
            NPOIFSFileSystem fs = null;
            DirectoryEntry root = null;
            DocumentNode sinfDoc = null;
            DocumentNode dinfDoc = null;
            SummaryInformation sinf = null;
            DocumentSummaryInformation dinf = null;
           
            // We need to work on a File for in-place changes, so create a temp one
            final File copy = TempFile.createTempFile("Test-HPSF", "ole2");
View Full Code Here

      for(Iterator it = dir.getEntries(); it.hasNext(); ) {
        Object entry = it.next();
        if(entry instanceof DirectoryNode) {
          displayDirectory((DirectoryNode)entry, newIndent);
        } else {
          DocumentNode doc = (DocumentNode)entry;
          String name = doc.getName();
          if(name.charAt(0) < 10) {
            String altname = "(0x0" + (int)name.charAt(0) + ")" + name.substring(1);
            name = name.substring(1) + " <" + altname + ">";
          }
          System.out.println(newIndent + name);
View Full Code Here

      hadChildren = true;
      Object 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);
      }
    }
View Full Code Here

        hadChildren = true;
        Object 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);
        }
      }
View Full Code Here

         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) {
View Full Code Here

     */
    private static MediaType processCompObjFormatType(DirectoryEntry root) {
        try {
            Entry e = root.getEntry("\u0001CompObj");
            if (e != null && e.isDocumentEntry()) {
                DocumentNode dn = (DocumentNode)e;
                DocumentInputStream stream = new DocumentInputStream(dn);
                byte [] bytes = IOUtils.toByteArray(stream);
                /*
                 * This array contains a string with a normal ASCII name of the
                 * application used to create this file. We want to search for that
View Full Code Here

     */
    private static MediaType processCompObjFormatType(DirectoryEntry root) {
        try {
            Entry e = root.getEntry("\u0001CompObj");
            if (e != null && e.isDocumentEntry()) {
                DocumentNode dn = (DocumentNode)e;
                DocumentInputStream stream = new DocumentInputStream(dn);
                byte [] bytes = IOUtils.toByteArray(stream);
                /*
                 * This array contains a string with a normal ASCII name of the
                 * application used to create this file. We want to search for that
View Full Code Here

    private static MediaType processStarDrawOrImpress(DirectoryEntry root) {
        try {
            Entry e = root.getEntry("\u0001CompObj");
            if (e != null && e.isDocumentEntry()) {
                DocumentNode dn = (DocumentNode)e;
                DocumentInputStream stream = new DocumentInputStream(dn);
                byte [] bytes = IOUtils.toByteArray(stream);
                /*
                 * This array contains a string with a normal ASCII name of the
                 * application used to create this file. We want to search for that
View Full Code Here

TOP

Related Classes of org.apache.poi.poifs.filesystem.DocumentNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.