]> source.dussan.org Git - poi.git/commitdiff
Fixed WorkbookFactory.create(InputStream) to throw specific Exceptions
authorJosh Micich <josh@apache.org>
Thu, 12 Feb 2009 23:48:12 +0000 (23:48 +0000)
committerJosh Micich <josh@apache.org>
Thu, 12 Feb 2009 23:48:12 +0000 (23:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@743934 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java

index d2f0f43e2792d65b78d426fd81ffa8d82d40d43d..9b42f0ee74f017232c8fd23e6022ec50f67a235f 100644 (file)
@@ -24,6 +24,7 @@ import org.apache.poi.POIXMLDocument;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.opc.Package;
 
 /**
@@ -49,7 +50,7 @@ public class WorkbookFactory {
         * Your input stream MUST either support mark/reset, or
         *  be wrapped as a {@link PushbackInputStream}!
         */
-       public static Workbook create(InputStream inp) throws Exception {
+       public static Workbook create(InputStream inp) throws IOException, InvalidFormatException {
                // If clearly doesn't do mark/reset, wrap up
                if(! inp.markSupported()) {
                        inp = new PushbackInputStream(inp, 8);