poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1662074 - /poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
Date Tue, 24 Feb 2015 18:20:02 GMT
Author: nick
Date: Tue Feb 24 18:20:02 2015
New Revision: 1662074

URL: http://svn.apache.org/r1662074
Log:
Update Javadocs to refer to the fact that WorkbookFactory.create will throw a EncryptedDocumentException
if the file is password protected

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java?rev=1662074&r1=1662073&r2=1662074&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java Tue Feb 24 18:20:02
2015
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.PushbackInputStream;
 
+import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.POIXMLDocument;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -73,8 +74,9 @@ public class WorkbookFactory {
      *  than using a {@link File}.</p> 
      * <p>Note that in order to properly release resources the 
      *  Workbook should be closed after use.
+     * @throws EncryptedDocumentException If the workbook given is password protected
      */
-    public static Workbook create(InputStream inp) throws IOException, InvalidFormatException
{
+    public static Workbook create(InputStream inp) throws IOException, InvalidFormatException,
EncryptedDocumentException {
         // If clearly doesn't do mark/reset, wrap up
         if (! inp.markSupported()) {
             inp = new PushbackInputStream(inp, 8);
@@ -94,8 +96,9 @@ public class WorkbookFactory {
      *  the given File, which must exist and be readable.
      * <p>Note that in order to properly release resources the 
      *  Workbook should be closed after use.
+     * @throws EncryptedDocumentException If the workbook given is password protected
      */
-    public static Workbook create(File file) throws IOException, InvalidFormatException {
+    public static Workbook create(File file) throws IOException, InvalidFormatException,
EncryptedDocumentException {
         if (! file.exists()) {
             throw new FileNotFoundException(file.toString());
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message