View Javadoc

1   package com.atlassian.plugin.webresource;
2   
3   import com.atlassian.plugin.servlet.DownloadableResource;
4   
5   import java.util.Map;
6   
7   /**
8    * Constructs a plugin resource from a given url
9    * @since 2.9.0
10   */
11  interface DownloadableResourceBuilder
12  {
13      /**
14       * Returns true if the builder can parse the given url
15       * @param path - the url to parse
16       * @return true if the builder can parse the given url
17       */
18      public boolean matches(String path);
19  
20      /**
21       * Parses the url and params and then builds a resource to upload
22       * If the resource cannot be found null is returned.
23       * @param path - the url
24       * @param params - query parameters provided in the url
25       * @return a resource to upload
26       * @throws UrlParseException - if the path cannot be parsed
27       */
28      public DownloadableResource parse(String path, Map<String, String> params) throws UrlParseException;
29  }