Examples of POIFSFileSystem


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

  {
   StringBuffer sheetText = new StringBuffer();
   try
   {
    logger.info("Extracting text from spreadsheet " + ifile);
    POIFSFileSystem poiFS = new POIFSFileSystem(new FileInputStream(new File(ifile)));
    HSSFWorkbook cworkBook = new HSSFWorkbook(poiFS);

    //*-- loop through the individual sheets and parse each one
    for (int i = 0; i < cworkBook.getNumberOfSheets(); i++)
    { HSSFSheet cSheet = cworkBook.getSheetAt(i);
View Full Code Here

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

                final String charset, final InputStream source) throws Parser.Failure,
                InterruptedException {
            try {
               
                //create a new org.apache.poi.poifs.filesystem.Filesystem
                final POIFSFileSystem poifs = new POIFSFileSystem(source);
                //get the Workbook (excel part) stream in a InputStream
                final InputStream din = poifs.createDocumentInputStream("Workbook");
                //construct out HSSFRequest object
                final HSSFRequest req = new HSSFRequest();
                //lazy listen for ALL records with the listener shown above
                req.addListenerForAllRecords(this);
                //create our event factory
View Full Code Here

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

    int sheetNullCounter = 0;

    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      StringBuilder content = new StringBuilder(bis.available());
      POIFSFileSystem fs = new POIFSFileSystem(bis);
      HSSFWorkbook workbook = new HSSFWorkbook(fs);

      for (int sheetNumber = 0; sheetNumber < workbook.getNumberOfSheets(); sheetNumber++) {
        HSSFSheet sheet = workbook.getSheetAt(sheetNumber);
        if (sheet != null) {
View Full Code Here

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

  protected String readContent(VFSLeaf leaf) throws IOException,DocumentException {
    BufferedInputStream bis = null;
    StringBuilder sb = new StringBuilder();
    try {
      bis = new BufferedInputStream(leaf.getInputStream());
      POIFSFileSystem filesystem = new POIFSFileSystem(bis);
      Iterator<?> entries = filesystem.getRoot().getEntries();
      while (entries.hasNext()) {
        Entry entry = (Entry) entries.next();
        String name = entry.getName();
        if (!(entry instanceof DocumentEntry)) {
          // Skip directory entries
View Full Code Here

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

     *            the ms-excel data stream
     */
    public void parseFile(InputStream inStream)
    {
        InputStream din = null;
        POIFSFileSystem poifs=null;
       
        try
        {
            poifs = new POIFSFileSystem( inStream );
           
            // Get the workbook for further references
            _workbook = new HSSFWorkbook(poifs);          
           
            // get the Workbook (excel part) stream in a InputStream
            din = poifs.createDocumentInputStream( WORKBOOK );
            HSSFRequest req = new HSSFRequest( );
            // lazy listen for ALL records with the listener shown above
            req.addListenerForAllRecords( this );
            HSSFEventFactory factory = new HSSFEventFactory( );
            factory.processEvents( req,
View Full Code Here

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

     }
     fail("'" + needle + "' wasn't found in '" + haystack + "'");
  }
 
   public void testQuick() throws Exception {
      POIFSFileSystem simple = new POIFSFileSystem(
            new FileInputStream(samples.getFile("quick.msg"))
      );
      MAPIMessage msg = new MAPIMessage(simple);
     
      OutlookTextExtactor ext = new OutlookTextExtactor(msg);
View Full Code Here

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

      assertContains(text, "Date: " + dateText + "\n");
      assertContains(text, "The quick brown fox jumps over the lazy dog");
   }
  
   public void testSimple() throws Exception {
      MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(
            new FileInputStream(samples.getFile("simple_test_msg.msg"))
      ));
     
      OutlookTextExtactor ext = new OutlookTextExtactor(msg);
      String text = ext.getText();
View Full Code Here

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

   public void testConstructors() throws Exception {
      String inp = (new OutlookTextExtactor(new FileInputStream(
            samples.getFile("simple_test_msg.msg")
      )).getText());
      String poifs = (new OutlookTextExtactor(new POIFSFileSystem(new FileInputStream(
            samples.getFile("simple_test_msg.msg")
      ))).getText());
      String mapi = (new OutlookTextExtactor(new MAPIMessage(new FileInputStream(
            samples.getFile("simple_test_msg.msg")
      ))).getText());
View Full Code Here

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

     
      String[] files = new String[] {
            "example_sent_regular.msg", "example_sent_unicode.msg"
      };
      for(String file : files) {
         MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(
               new FileInputStream(samples.getFile(file))
         ));
        
         OutlookTextExtactor ext = new OutlookTextExtactor(msg);
         String text = ext.getText();
View Full Code Here

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

     
      String[] files = new String[] {
            "example_received_regular.msg", "example_received_unicode.msg"
      };
      for(String file : files) {
         MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(
               new FileInputStream(samples.getFile(file))
         ));
        
         OutlookTextExtactor ext = new OutlookTextExtactor(msg);
         String text = ext.getText();
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.