You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2016/11/11 10:29:42 UTC
svn commit: r1769270 -
/poi/site/src/documentation/content/xdocs/encryption.xml
Author: nick
Date: Fri Nov 11 10:29:42 2016
New Revision: 1769270
URL: http://svn.apache.org/viewvc?rev=1769270&view=rev
Log:
Comments
Modified:
poi/site/src/documentation/content/xdocs/encryption.xml
Modified: poi/site/src/documentation/content/xdocs/encryption.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/encryption.xml?rev=1769270&r1=1769269&r2=1769270&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/encryption.xml (original)
+++ poi/site/src/documentation/content/xdocs/encryption.xml Fri Nov 11 10:29:42 2016
@@ -222,11 +222,13 @@ EncryptionInfo info = new EncryptionInfo
Encryptor enc = info.getEncryptor();
enc.confirmPassword("foobaa");
+// Read in an existing OOXML file
OPCPackage opc = OPCPackage.open(new File("..."), PackageAccess.READ_WRITE);
OutputStream os = enc.getDataStream(fs);
opc.save(os);
opc.close();
+// Write out the encrypted version
FileOutputStream fos = new FileOutputStream("...");
fs.writeFilesystem(fos);
fos.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org