Hi Ajeet,

I've created a small test for you (.docx only!): http://pastebin.com/q1Ec62dw

In addition I have added the code which I have written the to read docx and doc 
both.

I've probably have been a bit too dozy this morning - there's no de-/encryption 
support for the old doc format -
the only old format which can be decrypted (but not encrypted) is .xls (see 
http://poi.apache.org/encryption.html)

>  Exception thrown is:- java.io.FileNotFoundException: no such entry: 
"EncryptionInfo"

Maybe a misleading error message, but it means there's no EncryptionInfo stream 
in your old doc files,
i.e. the encryption works differently for older binary files and this stream is 
never created for them.

One more info for the test:
Currently in-place overwriting encrypted files with the NPOIFS is not possible.
There are at least 2 bugs in the encryption classes (which I've already fixed 
locally)
and something to be further investigated in the NPOIFS classes.
So simply use the old POIFS classes for the time being.

Andi

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to