@Test public void shouldUseHeadersToHttpResponse() throws IOException { FileDownload fd = new FileDownload(file, "type", "x.txt", false); fd.write(response); verify(response, times(1)).setHeader("Content-type", "type"); verify(response, times(1)).setHeader("Content-disposition", "inline; filename=x.txt"); assertArrayEquals(bytes, outputStream.toByteArray()); }
public void write(HttpServletResponse response) throws IOException { inputDownload.write(response); }
FileDownload implements Download { public void write(HttpServletResponse response) throws IOException { inputDownload.write(response); } }
FileDownload implements Download { public void write(HttpServletResponse response) throws IOException { inputDownload.write(response); } FileDownload(File file, String contentType, String fileName);  FileDownload(File file, String contentType);  FileDownload(File file, String contentType, String fileName, boolean doDownload); }
FileDownload implements Download { public void write(HttpServletResponse response) throws IOException { inputDownload.write(response); } FileDownload(File file, String contentType, String fileName);  FileDownload(File file, String contentType);  FileDownload(File file, String contentType, String fileName, boolean doDownload); void write(HttpServletResponse response); }
FileDownload implements Download { public void write(HttpServletResponse response) throws IOException { inputDownload.write(response); } FileDownload(File file, String contentType, String fileName);  FileDownload(File file, String contentType);  FileDownload(File file, String contentType, String fileName, boolean doDownload); void write(HttpServletResponse response);  }