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   * @see {@link Plugin#getResourceAsStream(String)}.
11   */
12  public class DownloadableClasspathResource extends AbstractDownloadableResource
13  {
14      public DownloadableClasspathResource(Plugin plugin, ResourceLocation resourceLocation, String extraPath)
15      {
16          super(plugin, resourceLocation, extraPath);
17      }
18  
19      protected InputStream getResourceAsStream()
20      {
21          return plugin.getResourceAsStream(getLocation());
22      }
23  }