[jboss-dev-forums] [Embedded JBoss Development] - ShrinkWrap Export to File
ALRubinger
do-not-reply at jboss.com
Mon Oct 19 07:03:53 EDT 2009
"Jaikiran" wrote :
| I happened to try out the ShrinkWrap (1.0.0-alpha-1) this weekend.
| Pretty useful stuff, especially in test case environments :) I read
| through the project wiki http://www.jboss.org/community/wiki/ShrinkWrap
| and even tried out my own few testcases. Works great!
|
| One of things that i noticed in my tests was that i kept repeating a
| piece of boilerplate code. As shown in the example in your wiki for
| exporting jars (wars, ears etc...) we get hold of the InputStream from
| the ZipExporter. However, the step of writing out to the file system
| using an output stream is left to the client of the API:
|
| // Export to the Filesystem as a real JAR
| | InputStream zipStream = ZipExporter.exportZip(archive);
| | // Get a FileOutputStream and then write the contents of "zipStream" to it
|
|
| Was this intentional? In my tests, after exporting, i had to almost
| always write out the stream to the file. Although it's not complicated,
| clients of the API could probably avoid this extra code if the
| ShrinkWrap API added a new API which accepts the File to which the
| archive has to be exported?
|
| Something like:
|
| void ZipExporter.exportZip(archive, File outputFile)
|
|
| Thoughts?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261019#4261019
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261019
More information about the jboss-dev-forums
mailing list