@Override public DownloadStream getStream() { try { final DownloadStream ds = new DownloadStream( new FileInputStream(sourceFile), getMIMEType(), getFilename()); ds.setParameter("Content-Length", String.valueOf(sourceFile.length())); ds.setBufferSize(getBufferSize()); ds.setCacheTime(getCacheTime()); return ds; } catch (final FileNotFoundException e) { throw new RuntimeException( "File not found: " + sourceFile.getName(), e); } }
stream.setParameter(DownloadStream.CONTENT_DISPOSITION, contentDisposition);
/** * Set DownloadStream-Parameter "Content-Disposition" to atachment, * therefore the Stream is downloaded and is not parsed as for example * "normal" xml. */ @Override public DownloadStream getStream() { DownloadStream ds = super.getStream(); ds.setParameter("Content-Disposition", "attachment; filename=\"" + getFilename() + "\""); return ds; }
/** * Set DownloadStream-Parameter "Content-Disposition" to atachment, * therefore the Stream is downloaded and is not parsed as for example * "normal" xml. */ @Override public DownloadStream getStream() { DownloadStream ds = super.getStream(); ds.setParameter("Content-Disposition", "attachment; filename=\"" + getFilename() + "\""); return ds; }
/** * Set DownloadStream-Parameter "Content-Disposition" to atachment, * therefore the Stream is downloaded and is not parsed as for example * "normal" xml. */ @Override public DownloadStream getStream() { DownloadStream ds = super.getStream(); ds.setParameter("Content-Disposition", "attachment; filename=\"" + getFilename() + "\""); return ds; }
@Override public DownloadStream getStream() { final DownloadStream stream = super.getStream(); if (StringUtils.isNotBlank(getFilename())) { String encodedFilename = EncodeUtil.rfc5987Encode(getFilename()); stream.setParameter("Content-Disposition", String.format("attachment;filename=\"%s\"; filename*=utf-8''%s", encodedFilename, encodedFilename)); } return stream; }
String fileName = URLEncoder.encode(retrievalName, "UTF8"); ds.setParameter("Content-Disposition", "attachment; filename*=\"utf-8'" + fileName + "\""); return ds;
@Override public DownloadStream getStream() { ByteArrayInputStream in = new ByteArrayInputStream( attachment.getBody()); DownloadStream ds = new DownloadStream(in, attachment.getMIMEType(), attachment.getFileName()); // Need a file download POPUP ds.setParameter("Content-Disposition", "attachment; filename="+attachment.getFileName()); return ds; } };
public DownloadStream getStream() { DownloadStream ds = super.getStream(); ds.setParameter("Content-Encoding", "deflate"); return ds;
stream.setParameter("Content-Disposition", "attachment; filename=\"" + stream.getFileName() + "\"");
stream.setParameter(DownloadStream.CONTENT_DISPOSITION, contentDisposition);