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
 boolean doesResourceExist(java.lang.String name)
           
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.InputStream getResourceAsStream(java.lang.String fileName)
           
 java.io.File toFile()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JarPluginArtifact

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

doesResourceExist

public boolean doesResourceExist(java.lang.String name)
Specified by:
doesResourceExist in interface PluginArtifact
Returns:
true if the resource exists in this artifact, otherwise false

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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface PluginArtifact
Returns:
a buffered file input stream of the file on disk. This input stream is not resettable.

toFile

public java.io.File toFile()
Specified by:
toFile in interface PluginArtifact
Returns:
the artifact as a file, or its underlying file if it is already one


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.