View Javadoc
1   package com.atlassian.plugin.servlet;
2   
3   import com.atlassian.plugin.Plugin;
4   import com.atlassian.plugin.elements.ResourceLocation;
5   
6   import java.io.InputStream;
7   
8   /**
9    * A {@link DownloadableResource} that will serve the resource from the plugin.
10   *
11   * @see {@link Plugin#getResourceAsStream(String)}.
12   */
13  public class DownloadableClasspathResource extends AbstractDownloadableResource {
14      public DownloadableClasspathResource(Plugin plugin, ResourceLocation resourceLocation, String extraPath) {
15          super(plugin, resourceLocation, extraPath);
16      }
17  
18      @Override
19      protected InputStream getResourceAsStream(final String resourceLocation) {
20          return plugin.getResourceAsStream(resourceLocation);
21      }
22  
23      public ResourceLocation getResourceLocation() {
24          return resourceLocation;
25      }
26  }