com.atlassian.plugin
Class FilePluginJar

java.lang.Object
  extended by com.atlassian.plugin.FilePluginJar
All Implemented Interfaces:
PluginJar

public class FilePluginJar
extends java.lang.Object
implements PluginJar

The implementation of PluginJar which reads from a specified file on disk.

See Also:
PluginJar

Constructor Summary
FilePluginJar(java.io.File jarFile)
           
 
Method Summary
 java.io.InputStream getFile(java.lang.String fileName)
           
 java.lang.String getFileName()
           
 java.io.InputStream getInputStream()
          Returns an InputStream for the entire plugin JAR.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePluginJar

public FilePluginJar(java.io.File jarFile)
Method Detail

getFile

public java.io.InputStream getFile(java.lang.String fileName)
                            throws PluginParseException
Specified by:
getFile in interface PluginJar
Returns:
an input stream for the this file in the jar. Closing this stream also closes the jar file this stream comes from.
Throws:
PluginParseException - if the file was not found or could not be read from the JAR.

getFileName

public java.lang.String getFileName()
Specified by:
getFileName in interface PluginJar
Returns:
the original name of the plugin JAR file. Typically used for persisting it to disk with a meaningful name.

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: PluginJar
Returns an InputStream for the entire plugin JAR. Calling this multiple times will return a fresh input stream each time.

Specified by:
getInputStream in interface PluginJar
Returns:
a buffered file input stream of the file on disk. This input stream is not resettable.


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.