View Javadoc
1   package com.atlassian.plugin.util.resource;
2   
3   import java.io.InputStream;
4   import java.net.URL;
5   
6   /**
7    * An alternative resource loader for use by plugins that wish to also support loading resources outside the usual
8    * resource loading of the particular plugin type.
9    *
10   * @since 2.2.0
11   */
12  public interface AlternativeResourceLoader {
13      /**
14       * Retrieve the URL of the resource from the directories.
15       *
16       * @param path the name of the resource to be loaded
17       * @return The URL to the resource, or null if the resource is not found
18       */
19      URL getResource(String path);
20  
21      /**
22       * Load a given resource from the directories.
23       *
24       * @param name The name of the resource to be loaded.
25       * @return An InputStream for the resource, or null if the resource is not found.
26       */
27      InputStream getResourceAsStream(String name);
28  }