aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2015-02-24 18:20:02 +0000
committerNick Burch <nick@apache.org>2015-02-24 18:20:02 +0000
commit51209bc957305808009e82ad075c9375802b094b (patch)
tree75682e5c31d86d13c1de50935da8cdadc69097c6 /src
parent42d9b312963a80045033875154f94fad553a781b (diff)
downloadpoi-51209bc957305808009e82ad075c9375802b094b.tar.gz
poi-51209bc957305808009e82ad075c9375802b094b.zip
Update Javadocs to refer to the fact that WorkbookFactory.create will throw a EncryptedDocumentException if the file is password protected
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1662074 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java b/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
index de847fd19a..747d88c263 100644
--- a/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
+++ b/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
@@ -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());
}