You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Harsh <hh...@yahoo.com> on 2005/02/06 22:43:41 UTC
ZipOutputStream & DataHanlder
>
> Hello
>
>
> I am new to Axis and working on implementing web service method which takes 2
> files as attachments.
> I am sending a zip file and a xml file. XML file is used to run
> transformations
> on the xml files packaged in the zip file.
> So now the modified xml files I am again zipping it up and trying to send
> back
> to client.
>
>
> I have a ZipOutputStream , which I use to populate with ZipEntry objects
> I need to get the DataHandler object for the web services method.
> How do I create the File object from ZipOutPutStream?
>
> Any ideas?
> Please help.
>
>
>
>
> //new zip file
> ZipOutputStream outfile = new ZipOutputStream(new
> FileOutputStream(suggestedName));
>
> while (noOfFiles.hasNext()) {
>
> ZipEntry e = new ZipEntry(fileName);
> outfile.putNextEntry(e);
>
> baos = fileObj.getContentOutputStream();
> baos.writeTo(outfile);
>
> outfile.closeEntry();
> }
>
>
> // return new DataHandler(new FileDataSource(new File("zipFile"))
>
> Thanks for your time
>
> -harsh
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
> http://promotions.yahoo.com/new_mail
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com