View Javadoc

1   package com.atlassian.plugin.servlet;
2   
3   import javax.servlet.http.HttpServletRequest;
4   import javax.servlet.http.HttpServletResponse;
5   
6   public interface DownloadStrategy
7   {
8       /**
9        * Returns true if the DownloadStrategy is supported for the given url path.
10       *
11       * @param requestUri the result of {@link HttpServletRequest#getRequestURI()} converted to lowercase
12       */
13      boolean matches(String requestUri);
14  
15      /**
16       * Serves the file for the given request and response.
17       * @throws DownloadException if there was an error during serving of the file.
18       */
19      void serveFile(HttpServletRequest request, HttpServletResponse response) throws DownloadException;
20  }