You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by hdumbre <hd...@globeop.com> on 2013/02/23 07:35:08 UTC

problem while striping password from xlsx large file

Hi All, 

I m using POI.3.8 , i have one requirement to strip the password from xlsx
file. 
I m using following code, 

POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(path)); 
EncryptionInfo info = new EncryptionInfo(fs); 
Decryptor d = Decryptor.getInstance(info); 
if (d.verifyPassword(password)) { 
XSSFWorkbook wb = new XSSFWorkbook(d.getDataStream(fs)); 
FileOutputStream fi = new FileOutputStream(path); 
wb.write(fi); 
fi.close(); 


It is working fine with me for 2-5 MB file ,but some input files are more
than 50MB , it taking more time and also giving OutOffMemoryException,then i
increase my ram size to 8GB but still no luck... 


Please help me if some one knows any solution for this 
                


Thanks in advance



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/problem-while-striping-password-from-xlsx-large-file-tp5712185.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: problem while striping password from xlsx large file

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 22 Feb 2013, hdumbre wrote:
> I m using following code,
>
> POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(path));
> EncryptionInfo info = new EncryptionInfo(fs);
> Decryptor d = Decryptor.getInstance(info);
> if (d.verifyPassword(password)) {
> XSSFWorkbook wb = new XSSFWorkbook(d.getDataStream(fs));
> FileOutputStream fi = new FileOutputStream(path);
> wb.write(fi);
> fi.close();

Why are you opening the stream as XSSFWorkbook and saving it out? Why not 
just write the stream straight to the file?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org