1 package org.jahia.services.fileextraction; 2 3 import java.io.IOException ; 4 import java.io.InputStream ; 5 import java.io.Reader ; 6 7 import org.apache.slide.extractor.MSExcelExtractor; 8 import org.jahia.utils.FileUtils; 9 10 11 21 22 public class JahiaMSExcelExtractor extends JahiaOfficeExtractor { 23 24 private static org.apache.log4j.Logger logger = 25 org.apache.log4j.Logger.getLogger (JahiaMSExcelExtractor.class); 26 27 public JahiaMSExcelExtractor(){ 28 } 29 30 40 public String getContentAsString(String path, long lastModified, 41 InputStream fileStream) 42 throws IOException { 43 return getContentAsString(path, lastModified, fileStream, null); 44 } 45 46 56 public String getContentAsString(String path, long lastModified, 57 InputStream fileStream, String charSet) 58 throws IOException { 59 MSExcelExtractor ex = new MSExcelExtractor("","",""); 60 try { 61 Reader reader = ex.extract(fileStream); 62 return FileUtils.readerToString(reader); 63 } catch ( Throwable t ){ 64 logger.debug("Exception extraction file " + path, t); 65 throw new IOException (t.getMessage()); 66 } 67 } 68 69 } 70 | Popular Tags |