Rev 200 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 200 | Rev 204 | ||
|---|---|---|---|
| Line 185... | Line 185... | ||
| 185 | ByteArrayOutputStream stream = new ByteArrayOutputStream(); |
185 | ByteArrayOutputStream stream = new ByteArrayOutputStream(); |
| 186 | wb.write(stream); |
186 | wb.write(stream); |
| 187 | stream.close(); |
187 | stream.close(); |
| 188 | wb.close(); |
188 | wb.close(); |
| 189 | System.out.println("Finalizado!"); |
189 | System.out.println("Finalizado!"); |
| 190 | return new DefaultStreamedContent(ArquivoUtil.gerarInputStreamDeArquivo(stream.toByteArray()), TipoExtensao.EXCEL.getDescricao(), "pedidos.xls"); |
- | |
| - | 190 | return DefaultStreamedContent.builder() |
|
| - | 191 | .contentType(TipoExtensao.EXCEL.getDescricao()) |
|
| - | 192 | .name("pedidos.xls") |
|
| - | 193 | .stream(() -> { |
|
| - | 194 | try { |
|
| - | 195 | return ArquivoUtil.gerarInputStreamDeArquivo(stream.toByteArray()); |
|
| - | 196 | } catch (IOException e) { |
|
| - | 197 | throw new RuntimeException(e); |
|
| - | 198 | }
|
|
| - | 199 | }).build(); |
|
| 191 | } catch (FileNotFoundException e) { |
200 | } catch (FileNotFoundException e) { |
| 192 | e.printStackTrace(); |
201 | e.printStackTrace(); |
| 193 | } catch (IOException e) { |
202 | } catch (IOException e) { |
| 194 | e.printStackTrace(); |
203 | e.printStackTrace(); |
| 195 | }
|
204 | }
|