com.atlassian.plugin
Class XmlPluginArtifact

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

public class XmlPluginArtifact
extends Object
implements PluginArtifact

An XML plugin artifact that is just the atlassian-plugin.xml file

Since:
2.1.0

Constructor Summary
XmlPluginArtifact(File xmlFile)
           
 
Method Summary
 boolean doesResourceExist(String name)
          Always returns false, since it doesn't make sense for an XML artifact
 InputStream getInputStream()
           
 String getName()
           
 InputStream getResourceAsStream(String name)
          Always returns null, since it doesn't make sense for an XML artifact
 File toFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlPluginArtifact

public XmlPluginArtifact(File xmlFile)
Method Detail

doesResourceExist

public boolean doesResourceExist(String name)
Always returns false, since it doesn't make sense for an XML artifact

Specified by:
doesResourceExist in interface PluginArtifact
Returns:
true if the resource exists in this artifact, otherwise false

getResourceAsStream

public InputStream getResourceAsStream(String name)
                                throws PluginParseException
Always returns null, since it doesn't make sense for an XML artifact

Specified by:
getResourceAsStream in interface PluginArtifact
Returns:
an input stream of the resource specified inside the artifact. Null if the resource cannot be found.
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.

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 © 2010 Atlassian. All Rights Reserved.