Improve method signature.
This commit is contained in:
parent
fd327f01d7
commit
dd739bb532
1 changed files with 15 additions and 2 deletions
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue