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.MSPowerPointExtractor; 8 import org.jahia.utils.FileUtils; 9 10 11 22 23 public class JahiaMSPowerPointExtractor extends JahiaOfficeExtractor { 24 25 private static org.apache.log4j.Logger logger = 26 org.apache.log4j.Logger.getLogger (JahiaMSPowerPointExtractor.class); 27 28 public JahiaMSPowerPointExtractor(){ 29 } 30 31 41 public String getContentAsString(String path, long lastModified, 42 InputStream fileStream) 43 throws IOException { 44 return getContentAsString(path, lastModified, fileStream, null); 45 } 46 47 57 public String getContentAsString(String path, long lastModified, 58 InputStream fileStream, String charSet) 59 throws IOException { 60 MSPowerPointExtractor ex = new MSPowerPointExtractor("","",""); 61 try { 62 Reader reader = ex.extract(fileStream); 63 return FileUtils.readerToString(reader); 64 } catch ( Throwable t ){ 65 logger.debug("Exception extraction file " + path, t); 66 throw new IOException (t.getMessage()); 67 } 68 } 69 70 } 71 | Popular Tags |