Examples of DirectoryNode


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

         POIFSFileSystem fs = new POIFSFileSystem(
             POIDataSamples.getSpreadSheetInstance().openResourceAsStream("excel_with_embeded.xls")
         );
         HSLFSlideShow ss;

         DirectoryNode dirA = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B6");
         DirectoryNode dirB = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B3");

         assertNotNull(dirA.getEntry("PowerPoint Document"));
         assertNotNull(dirB.getEntry("PowerPoint Document"));

         // Check the first file
         ss = new HSLFSlideShow(dirA, fs);
         ppe = new PowerPointExtractor(ss);
         assertEquals("Sample PowerPoint file\nThis is the 1st file\nNot much too it\n",
View Full Code Here

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

  public void testExtractFromEmbeded() throws Exception {
    POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getSpreadSheetInstance().openResourceAsStream(filename3));
    HWPFDocument doc;
    WordExtractor extractor3;

    DirectoryNode dirA = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B7");
    DirectoryNode dirB = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B2");

    // Should have WordDocument and 1Table
    assertNotNull(dirA.getEntry("1Table"));
    assertNotNull(dirA.getEntry("WordDocument"));

    assertNotNull(dirB.getEntry("1Table"));
    assertNotNull(dirB.getEntry("WordDocument"));

    // Check each in turn
    doc = new HWPFDocument(dirA, fs);
    extractor3 = new WordExtractor(doc);
View Full Code Here

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

      // Find our top level children
      // Note - we don't handle children of children yet, as
      //  there doesn't seem to be any use of that in Outlook
      for(Entry entry : node) {
         if(entry instanceof DirectoryNode) {
            DirectoryNode dir = (DirectoryNode)entry;
            ChunkGroup group = null;
           
            // Do we know what to do with it?
            if(dir.getName().startsWith(AttachmentChunks.PREFIX)) {
               group = new AttachmentChunks(dir.getName());
            }
            if(dir.getName().startsWith(NameIdChunks.PREFIX)) {
               group = new NameIdChunks();
            }
            if(dir.getName().startsWith(RecipientChunks.PREFIX)) {
               group = new RecipientChunks(dir.getName());
            }
           
            if(group != null) {
               processChunks(dir, group);
               groups.add(group);
View Full Code Here

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

         POIFSFileSystem fs = new POIFSFileSystem(
             POIDataSamples.getSpreadSheetInstance().openResourceAsStream("excel_with_embeded.xls")
         );
         HSLFSlideShow ss;

         DirectoryNode dirA = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B6");
         DirectoryNode dirB = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B3");

         assertNotNull(dirA.getEntry("PowerPoint Document"));
         assertNotNull(dirB.getEntry("PowerPoint Document"));

         // Check the first file
         ss = new HSLFSlideShow(dirA);
         ppe = new PowerPointExtractor(ss);
         assertEquals("Sample PowerPoint file\nThis is the 1st file\nNot much too it\n",
View Full Code Here

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

    String filename = pdirname + "/word_with_embeded.doc";
    POIFSFileSystem fs = new POIFSFileSystem(
        new FileInputStream(filename)
    );
   
    DirectoryNode objPool = (DirectoryNode)
      fs.getRoot().getEntry("ObjectPool");
    DirectoryNode dirA = (DirectoryNode)
      objPool.getEntry("_1269427460");
    DirectoryNode dirB = (DirectoryNode)
      objPool.getEntry("_1269427461");

    HSSFWorkbook wbA = new HSSFWorkbook(dirA, fs, true);
    HSSFWorkbook wbB = new HSSFWorkbook(dirB, fs, true);
   
View Full Code Here

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

    String filename = pdirname + "/excel_with_embeded.xls";
    POIFSFileSystem fs = new POIFSFileSystem(
        new FileInputStream(filename)
    );
   
      DirectoryNode dirA = (DirectoryNode)
      fs.getRoot().getEntry("MBD0000A3B5");
    DirectoryNode dirB = (DirectoryNode)
      fs.getRoot().getEntry("MBD0000A3B4");
   
    HSSFWorkbook wbA = new HSSFWorkbook(dirA, fs, true);
    HSSFWorkbook wbB = new HSSFWorkbook(dirB, fs, true);
   
View Full Code Here

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

      // Find our top level children
      // Note - we don't handle children of children yet, as
      //  there doesn't seem to be any use of that in Outlook
      for(Entry entry : node) {
         if(entry instanceof DirectoryNode) {
            DirectoryNode dir = (DirectoryNode)entry;
            ChunkGroup group = null;
           
            // Do we know what to do with it?
            if(dir.getName().startsWith(AttachmentChunks.PREFIX)) {
               group = new AttachmentChunks(dir.getName());
            }
            if(dir.getName().startsWith(NameIdChunks.PREFIX)) {
               group = new NameIdChunks();
            }
            if(dir.getName().startsWith(RecipientChunks.PREFIX)) {
               group = new RecipientChunks(dir.getName());
            }
           
            if(group != null) {
               processChunks(dir, group);
               groups.add(group);
View Full Code Here

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

         POIFSFileSystem fs = new POIFSFileSystem(
             POIDataSamples.getSpreadSheetInstance().openResourceAsStream("excel_with_embeded.xls")
         );
         HSLFSlideShow ss;

         DirectoryNode dirA = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B6");
         DirectoryNode dirB = (DirectoryNode)
             fs.getRoot().getEntry("MBD0000A3B3");

         assertNotNull(dirA.getEntry("PowerPoint Document"));
         assertNotNull(dirB.getEntry("PowerPoint Document"));

         // Check the first file
         ss = new HSLFSlideShow(dirA);
         ppe = new PowerPointExtractor(ss);
         assertEquals("Sample PowerPoint file\nThis is the 1st file\nNot much too it\n",
View Full Code Here

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

  public void testExtractFromEmbeded() throws Exception {
    POIFSFileSystem fs = new POIFSFileSystem(POIDataSamples.getSpreadSheetInstance().openResourceAsStream(filename3));
    HWPFDocument doc;
    WordExtractor extractor3;

    DirectoryNode dirA = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B7");
    DirectoryNode dirB = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B2");

    // Should have WordDocument and 1Table
    assertNotNull(dirA.getEntry("1Table"));
    assertNotNull(dirA.getEntry("WordDocument"));

    assertNotNull(dirB.getEntry("1Table"));
    assertNotNull(dirB.getEntry("WordDocument"));

    // Check each in turn
    doc = new HWPFDocument(dirA, fs);
    extractor3 = new WordExtractor(doc);
View Full Code Here

Examples of org.corrib.s3b.sscf.tools.sscf2js.DirectoryNode

     
      hasContent = sfr.hasContent();
   
      nc.setType("siocForum");
     
      DirectoryNode dn = new DirectoryNode();
      dn.setId(sfr.getStringURI());
      dn.setLevel(level);
     
      if(sfr.getName()!=null&&!"".equals(sfr.getName()))
        dn.setLabel("Forum: "+sfr.getName());
      else if(sfr.getTitle()!=null&&!"".equals(sfr.getTitle()))
        dn.setLabel("Forum: "+sfr.getTitle());
      else dn.setLabel("Forum: "+sfr.getStringURI());
      dn.setOwn(isOwner);
      //TODO - get owner from this tags
      //dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
      //dn.setOwnerName((owner != null) ? (owner.getName()) : "");
      dn.setOwnerMbox("");
      dn.setOwnerName("");
      dn.setRemovable(!hasContent);
      dn.setLinkedIn(parentIsOwner&!isOwner);
     
      //check if user select this directory - we can get id or whole uri.
      if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
      {
        if(resource.getStringURI().equals(selectedUri)||
            resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
        {
          dn.setSelected(true);
          dn.setOpened(false);
        }
        else dn.setSelected(false);
      }
     
      dn.setStandalone(standalone);
      nc.setContent(dn);

    }
    else if (resource instanceof SiocSiteResource) {
      SiocSiteResource ssr = SiocSiteResource.getInstance(resource.getStringURI());
     
      hasContent = ssr.hasContent();

      nc.setType("siocSite");
   
      DirectoryNode dn = new DirectoryNode();
      dn.setId(resource.getResource().toString());
      dn.setLevel(level);
      dn.setLabel("Site: "+ssr.getTitle());
      dn.setOwn(isOwner);
      //TODO - get owner from this tags
      //dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
      //dn.setOwnerName((owner != null) ? (owner.getName()) : "");
      dn.setOwnerMbox("");
      dn.setOwnerName("");   
      dn.setRemovable(!hasContent);
      dn.setLinkedIn(parentIsOwner&!isOwner);
     
      //check if user select this directory - we can get id or whole uri.
      if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
      {
        if(resource.getStringURI().equals(selectedUri)||
            resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
        {
          dn.setSelected(true);
          dn.setOpened(false);
        }
        else dn.setSelected(false);
      }
     
      dn.setStandalone(standalone);
      nc.setContent(dn);
    }
   
    //add created nodes to the buffer
    nc.toJSON(buffer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.