I understand that, but specifically what is it in a .zip file that will cause 
this if statement to throw the IllegalStateException?  I don't understand where 
the values of text.length() and string.length() are coming from.
       int size = text.length() + string.length();
       if(size > ZipSecureFile.getMaxTextSize()) {
I'm getting this exception and I don't know what (in the .zip file) is causing 
this to be thrown.
The text would exceed the max allowed overall size of extracted text. By 
default this is prevented as some documents may exhaust available memory and it 
may indicate that the file is used to inflate memory usage and thus could pose 
a security risk. You can adjust this limit via ZipSecureFile.setMaxTextSize() 
if you need to work with files which have a lot of text. Size: 10485785, limit: 
MAX_TEXT_SIZE: 10485760

On 2019/03/22 18:39:06, Scott Gardner <[email protected]> wrote:
> Can someone explain what causes IllegalStateException to be thrown in>
> POIXMLTextExtractor.java?>
>
> In the file  org/apache/poi/POIXMLTextExtractor.java is this if statement>
>
>    if(size > ZipSecureFile.getMaxTextSize()) {>
>       throw new IllegalStateException("The text would exceed the max>
> allowed overall size of extracted text. ">
>         + "By default this is prevented as some documents may exhaust>
> available memory and it may indicate that the file is used to inflate>
> memory usage and thus could pose a security risk. ">
>         + "You can adjust this limit via ZipSecureFile.setMaxTextSize() if>
> you need to work with files which have a lot of text. ">
>         + "Size: " + size + ", limit: MAX_TEXT_SIZE: " +>
> ZipSecureFile.getMaxTextSize());>
>    }>
>
> Can someone tell me exactly what causes this message to be printed? What>
> does "The text" mean in the context of that message?>
> Can someone give me a .zip file that will cause this message to appear and>
> explain to me what it is about the contents of the .zip file>
> causes that message to be printed?>
>

Reply via email to