Bug in org.bonitasoft.engine.api.impl.ProcessAPIImpl.exportBarProcessContentUnderHome

1
0
-1

Hi, There is a bug in method exportBarProcessContentUnderHome in org.bonitasoft.engine.api.impl.ProcessAPIImpl class. Usually retured archive is invalid and cannot be unzipped later on. The problem is in closing ZipOutputStream too late (or return it's content too soon) so it is not finished yet. Please consider to alter the code.

Now this particular part of code looks like this:

             final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final ZipOutputStream zos = new ZipOutputStream(baos);
             try {
                 IOUtil.zipDir(processFolder.getPath(), zos, processFolder.getPath());
                 return baos.toByteArray();
             } finally {
                 zos.close();
                 baos.close();
             }

and should look like this:

             final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final ZipOutputStream zos = new ZipOutputStream(baos);
             try {
                 IOUtil.zipDir(processFolder.getPath(), zos, processFolder.getPath());
             } finally {
                 zos.close();
                 baos.close();
             }
             return baos.toByteArray();

Comments

Submitted by amine250 on Wed, 04/29/2015 - 14:36

Hi, You can report bugs in there https://bonita.atlassian.net/browse/BBPMC

Here in the forum, it won't get the attention it needs.

Regards; Amine.

1 answer

1
0
-1

Hi,

I created the ticket in our bug tracker. You can follow its resolution status here: https://bonita.atlassian.net/browse/BBPMC-270

Cheers,

Philippe

Notifications