Improve method signature.

This commit is contained in:
Christian P. MOMON 2013-09-11 02:27:07 +02:00
parent fd327f01d7
commit dd739bb532

View file

@ -60,13 +60,26 @@ public class XMLZipWriter extends XMLWriter
* @param target
* @throws IOException
*/
public XMLZipWriter(final OutputStream target) throws IOException
public XMLZipWriter(final OutputStream target, final String fileName, final String generator) throws IOException
{
super();
ZipOutputStream zos = new ZipOutputStream(target);
zos.setLevel(Deflater.BEST_COMPRESSION);
zos.setMethod(ZipOutputStream.DEFLATED);
zos.putNextEntry(new ZipEntry("noname"));
if (generator != null)
{
zos.setComment(generator);
}
String entryName;
if (fileName == null)
{
entryName = "noname";
}
else
{
entryName = fileName;
}
zos.putNextEntry(new ZipEntry(entryName));
this.out = new PrintWriter(new OutputStreamWriter(zos, "UTF-8"));
}
}