Class DownloadUtil

java.lang.Object
ubic.gemma.web.controller.util.DownloadUtil

@Component public class DownloadUtil extends Object
Utility class for providing Path as downloads.

If available, Tomcat sendfile is used.

Author:
poirigui
  • 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 from
      downloadName - 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.