add a util function; #52

Closed
wants to merge 1 commit into
from
@@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@@ -123,6 +124,18 @@ public static Document process( File xlsFile ) throws IOException, ParserConfigu
return doc;
}
+ public static Document process( InputStream xlsFile ) throws IOException, ParserConfigurationException
+ {
+ final HSSFWorkbook workbook = new HSSFWorkbook( xlsFile );
+ ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(
+ XMLHelper.getDocumentBuilderFactory().newDocumentBuilder()
+ .newDocument() );
+ excelToHtmlConverter.processWorkbook( workbook );
+ Document doc = excelToHtmlConverter.getDocument();
+ workbook.close();
+ return doc;
+ }
+
private String cssClassContainerCell = null;
private String cssClassContainerDiv = null;