How to find out a document is encrypted using java. While using POI error is thrown at constructor level only so no way to use any method on the object of wordDocument or hwpfdocument.
Sushil -----Original Message----- From: Daniel Noll [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 4:42 AM To: POI Users List Subject: Re: protected word doc Sushil Khekare wrote: > when i try to extract text from microsoft word document POI goes out > of memory when actually memory is not so much consumed by jvm. Any > body knows how to solve this also is there any new version of poi in > pipeline. Code goes out of memory at this line > > byte[] tableStream = new byte[size]; > > the file size is only 24 kb but it is password protected for opening. > > Any help?????? Encrypted documents, POI just tries to parse them as normal ones. What you're seeing here is some size value which has been encrypted, and the encrypted value is enormous, hence the OutOfMemoryError. The workaround is simple enough: if the document is encrypted, don't try to read in its text. Daniel -- Daniel Noll Nuix Pty Ltd Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Ph: +61 2 9280 0699 Web: http://www.nuix.com.au/ Fax: +61 2 9212 6902 This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this message or attachment is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
