struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Hamacher" <eric.hamac...@enetrix.com>
Subject zipping files for download
Date Wed, 02 Jul 2008 18:10:21 GMT
Hello:

 

I started writing a Struts 2 action which zips up the contents of a
directory on the filesystem and downloads it.  Everything was fine until
I discovered that java.util.zip.ZipOutputStream requires an OutputStream
in its constructor.  It doesn't seem like a good idea to get a reference
to the ServletOutputStream in my action and then use StreamResult later
on (if that is even necessary).  On the other hand, I could do the
zipping within a custom result but this also seems inappropriate.  The
ideal solution would be to have a custom result which somehow receives
from the action some type of object which contains Files in a tree
hierarchy.  I don't know, I'm new to Struts 2 so any feedback on this
matter would be appreciated.

 

Regards,

Eric Hamacher

 

******************************

THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
EMAIL TO eric.hamacher@enetrix.com *******************************

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message