externalContext.setResponseHeader("Content-Disposition", ComponentUtils.createContentDisposition(contentDispositionValue, content.getName())); externalContext.addResponseCookie(Constants.DOWNLOAD_COOKIE + monitorKeyValue, "true", Collections.<String, Object>emptyMap());
if (value instanceof StreamedContent && player.getType().equals("application/pdf")) { StreamedContent streamedContent = (StreamedContent) value; if (streamedContent.getName() != null) { int index = src.indexOf("?"); src = src.substring(0, index) + ";/" + streamedContent.getName() + "" + src.substring(index, src.length());
StreamedContent arquivo; public void prepararArquivoInformacoes(final StreamedContent arq) { InputStream stream = null; String caminho = FileHelper.retornarCaminhoPasta(selected.getEmpresa().getDiretorio(), FileHelper.INFORMACOES); try { stream = new FileInputStream(caminho + File.separator + arq.getName()); this.arquivo = new DefaultStreamedContent(stream, MimeTypes.valueOf("pdf").getMimeType(), arq.getName()); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public StreamedContent getArquivo() { return arquivo; }
externalContext.setResponseHeader("Content-Disposition", ComponentUtils.createContentDisposition(contentDispositionValue, content.getName())); externalContext.addResponseCookie(Constants.DOWNLOAD_COOKIE + monitorKeyValue, "true", Collections.<String, Object>emptyMap());
if (value != null && value instanceof StreamedContent && player.getType().equals("application/pdf")) { StreamedContent streamedContent = (StreamedContent) value; if (streamedContent.getName() != null) { int index = src.indexOf("?"); src = src.substring(0, index) + ";/" + streamedContent.getName() + "" + src.substring(index, src.length());