View Javadoc

1   package com.atlassian.plugin;
2   
3   import java.io.InputStream;
4   
5   /**
6    * Allows the retrieval of files and/or an input stream of a plugin artifact. Implementations
7    * must allow multiple calls to {@link #getInputStream()}.
8    *
9    * @see PluginController
10   */
11  public interface PluginArtifact
12  {
13      /**
14       * @return an input stream of the resource specified inside the artifact.  Null if the resource cannot be found.
15       * @throws PluginParseException if the there was an exception retrieving the resource from the artifact
16       */
17      InputStream getResourceAsStream(String name) throws PluginParseException;
18  
19      /**
20       * @return the original name of the plugin artifact file. Typically used
21       * for persisting it to disk with a meaningful name.
22       */
23      String getName();
24  
25      /**
26       * Returns an InputStream for the entire plugin artifact. Calling this
27       * multiple times will return a fresh input stream each time.
28       */
29      InputStream getInputStream();
30  }