com.atlassian.plugin
Class JarPluginArtifact
java.lang.Object
com.atlassian.plugin.JarPluginArtifact
- All Implemented Interfaces:
- PluginArtifact
public class JarPluginArtifact
- extends Object
- implements PluginArtifact
The implementation of PluginArtifact that is backed by a jar file.
- Since:
- 2.0.0
- See Also:
PluginArtifact
JarPluginArtifact
public JarPluginArtifact(File jarFile)
doesResourceExist
public boolean doesResourceExist(String name)
- Specified by:
doesResourceExist in interface PluginArtifact
- Returns:
- true if the resource exists in this artifact, otherwise false
getResourceAsStream
public InputStream getResourceAsStream(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 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 String toString()
- Overrides:
toString in class Object
getInputStream
public 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 File toFile()
- Specified by:
toFile in interface PluginArtifact
- Returns:
- the artifact as a file, or its underlying file if it is already one
Copyright © 2011 Atlassian. All Rights Reserved.