File tree Expand file tree Collapse file tree
vraptor-core/src/main/java/br/com/caelum/vraptor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424import javax .servlet .http .HttpServletResponse ;
2525
26- import org . apache . commons .io .IOUtils ;
26+ import com . google . common .io .ByteStreams ;
2727
2828/**
2929 * Handles download by reading from a input stream byte by byte.
@@ -55,7 +55,7 @@ public void write(HttpServletResponse response) throws IOException {
5555 writeDetails (response );
5656
5757 OutputStream out = response .getOutputStream ();
58- IOUtils .copy (stream , out );
58+ ByteStreams .copy (stream , out );
5959 }
6060
6161 void writeDetails (HttpServletResponse response ) {
Original file line number Diff line number Diff line change 2525
2626import javax .servlet .http .HttpServletResponse ;
2727
28- import org .apache .commons .io .IOUtils ;
28+ import com .google .common .io .ByteStreams ;
29+ import com .google .common .io .CharStreams ;
2930
3031/**
3132 * Implementation that delegates to HttpServletResponse
@@ -98,7 +99,7 @@ public HttpResult body(String body) {
9899
99100 public HttpResult body (InputStream body ) {
100101 try {
101- IOUtils .copy (body , response .getOutputStream ());
102+ ByteStreams .copy (body , response .getOutputStream ());
102103 } catch (IOException e ) {
103104 throw new ResultException ("Couldn't write to response body" , e );
104105 }
@@ -107,7 +108,7 @@ public HttpResult body(InputStream body) {
107108
108109 public HttpResult body (Reader body ) {
109110 try {
110- IOUtils .copy (body , response .getWriter ());
111+ CharStreams .copy (body , response .getWriter ());
111112 } catch (IOException e ) {
112113 throw new ResultException ("Couldn't write to response body" , e );
113114 }
You can’t perform that action at this time.
0 commit comments