public class ZipCodeWriter extends CodeWriter
Modifier and Type | Field and Description |
---|---|
private java.io.OutputStream |
filter |
private java.util.zip.ZipOutputStream |
zip |
encoding
Constructor and Description |
---|
ZipCodeWriter(java.io.OutputStream target) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Called by CodeModel at the end of the process.
|
java.io.OutputStream |
openBinary(JPackage pkg,
java.lang.String fileName)
Called by CodeModel to store the specified file.
|
private static java.lang.String |
toDirName(JPackage pkg)
Converts a package name to the directory name.
|
openSource
private final java.util.zip.ZipOutputStream zip
private final java.io.OutputStream filter
public ZipCodeWriter(java.io.OutputStream target)
target
- Zip file will be written to this stream.public java.io.OutputStream openBinary(JPackage pkg, java.lang.String fileName) throws java.io.IOException
CodeWriter
The returned stream will be closed before the next file is stored. So the callee can assume that only one OutputStream is active at any given time.
openBinary
in class CodeWriter
pkg
- The package of the file to be written.fileName
- File name without the path. Something like
"Foo.java" or "Bar.properties"java.io.IOException
private static java.lang.String toDirName(JPackage pkg)
public void close() throws java.io.IOException
CodeWriter
close
in class CodeWriter
java.io.IOException