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        * Returns true if the DownloadStrategy is supported for the given url path.
9        *
10       * @param requestUri the result of {@link HttpServletRequest#getRequestURI()} converted to lowercase
11       */
12      boolean matches(String requestUri);
13  
14      /**
15       * Serves the file for the given request and response.
16       *
17       * @throws DownloadException if there was an error during serving of the file.
18       */
19      void serveFile(HttpServletRequest request, HttpServletResponse response) throws DownloadException;
20  }