1 package com.atlassian.plugin.util.resource;
2
3 import java.net.URL;
4 import java.io.InputStream;
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 /**
15 * Retrieve the URL of the resource from the directories.
16 *
17 * @param path the name of the resource to be loaded
18 * @return The URL to the resource, or null if the resource is not found
19 */
20 URL getResource(String path);
21
22 /**
23 * Load a given resource from the directories.
24 *
25 * @param name The name of the resource to be loaded.
26 * @return An InputStream for the resource, or null if the resource is not found.
27 */
28 InputStream getResourceAsStream(String name);
29 }