View Javadoc

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