public class DownloadUtils extends Object
Provides utility methods related to the explicit download of resources.
Modifier and Type | Method and Description |
---|---|
static org.springframework.http.HttpHeaders |
getDownloadResponseHeaders(String fileName,
org.springframework.http.MediaType mediaType,
boolean forceDownload) |
static void |
setDownloadResponseHeaders(String fileName,
com.google.common.net.MediaType mimeType,
int length,
boolean forceDownload,
javax.servlet.http.HttpServletResponse response)
Set a download response into the given response instance.
|
public static void setDownloadResponseHeaders(String fileName, com.google.common.net.MediaType mimeType, int length, boolean forceDownload, javax.servlet.http.HttpServletResponse response)
Set a download response into the given response instance.
fileName
- the download file namemimeType
- the download file mime typelength
- the content lengthforceDownload
- true
to force the download by sending an attachment instead of form dataresponse
- the response instance to be setpublic static org.springframework.http.HttpHeaders getDownloadResponseHeaders(String fileName, org.springframework.http.MediaType mediaType, boolean forceDownload)
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.