Click to See Complete Forum and Search --> : Split huge file during writing.


TOMNKZ
July 23rd, 2007, 02:41 PM
Hi.

I have freemarker template, which produce huge file.

template.procced(bean, writer);

I have to provider a writer for this function, which split result on several files.

So, as I understand, the solution is to provide some ZipWriter, which archives file and split it into several files.

This way user, which receives result files could get the result file, without knowledge about how it was produced.

The question is how to realize this strategy? Any classes, which could help me?

Or any solution how to truncate writing after it have reached size limit? Result from template is html string, so I have to terminate file writing process, but result html should remain well-formed.

Any help and ideas welcome!:confused:

keang
July 24th, 2007, 09:21 AM
So, as I understand, the solution is to provide some ZipWriter, which archives file and split it into several files.

This way user, which receives result files could get the result file, without knowledge about how it was produced.

The question is how to realize this strategy? Any classes, which could help me?Java has the ability to write .zip files but not to split the zip file so there are no standard classes that will do what you want, but there are free splitters available such as HJSplit for Java (http://www.freebyte.com/hjsplit/) (which I've never used so can't vouch for) which may do what you want.