com.atlassian.plugin
Class JarPluginArtifact

java.lang.Object
  extended by com.atlassian.plugin.JarPluginArtifact
All Implemented Interfaces:
PluginArtifact

public class JarPluginArtifact
extends java.lang.Object
implements PluginArtifact

The implementation of PluginArtifact that is backed by a jar file.

Since:
2.0.0
See Also:
PluginArtifact

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

Constructor Detail

JarPluginArtifact

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

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String fileName)
                                        throws PluginParseException
Specified by:
getResourceAsStream in interface PluginArtifact
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 there was an exception retrieving the resource from the artifact

getName

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

getInputStream

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

Specified by:
getInputStream in interface PluginArtifact
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.