Package ubic.gemma.web.controller.util
Class DownloadUtil
java.lang.Object
ubic.gemma.web.controller.util.DownloadUtil
Utility class for providing
Path
as downloads.
If available, Tomcat sendfile is used.
- Author:
- poirigui
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DownloadUtil
public DownloadUtil()
-
-
Method Details
-
download
public void download(Path f, @Nullable String downloadName, String contentType, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean downloadAsAttachment) throws IOException - Parameters:
f
- the file to download fromdownloadName
- this string will be used as a download name for the downloaded file. If null, the filesystem name of the file will be used.response
- the http response to download to.- Throws:
IOException
- if the file in the given path can not be read.
-