You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/10/09 05:40:38 UTC
svn commit: r1763944 -
/poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
Author: onealj
Date: Sun Oct 9 05:40:38 2016
New Revision: 1763944
URL: http://svn.apache.org/viewvc?rev=1763944&view=rev
Log:
bug 60021: add note that EncryptionInfo may require poi-ooxml.jar to run EncryptionModes
Modified:
poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java?rev=1763944&r1=1763943&r2=1763944&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java Sun Oct 9 05:40:38 2016
@@ -34,6 +34,9 @@ import org.apache.poi.util.BitFieldFacto
import org.apache.poi.util.LittleEndianInput;
/**
+ * This class may require {@code poi-ooxml} to be on the classpath to load
+ * some {@link EncryptionMode}s.
+ * @see #getBuilder(EncryptionMode)
*/
public class EncryptionInfo implements Cloneable {
private final EncryptionMode encryptionMode;
@@ -193,6 +196,22 @@ public class EncryptionInfo implements C
eib.initialize(this, cipherAlgorithm, hashAlgorithm, keyBits, blockSize, chainingMode);
}
+ /**
+ * This method loads the builder class with reflection, which may generate
+ * a {@code ClassNotFoundException} if the class is not on the classpath.
+ * For example, {@link org.apache.poi.poifs.crypt.agile.AgileEncryptionInfoBuilder}
+ * is contained in the {@code poi-ooxml} package since the class makes use of some OOXML
+ * classes rather than using the {@code poi} package and plain XML DOM calls.
+ * As such, you may need to include {@code poi-ooxml} and {@code poi-ooxml-schemas} to load
+ * some encryption mode builders. See bug #60021 for more information.
+ * https://bz.apache.org/bugzilla/show_bug.cgi?id=60021
+ *
+ * @param encryptionMode the encryption mode
+ * @return an encryption info builder
+ * @throws ClassNotFoundException
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ */
protected static EncryptionInfoBuilder getBuilder(EncryptionMode encryptionMode)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org