com.atlassian.plugin
Class XmlPluginArtifact

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

public class XmlPluginArtifact
extends java.lang.Object
implements PluginArtifact

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

Since:
2.1.0

Constructor Summary
XmlPluginArtifact(java.io.File xmlFile)
           
 
Method Summary
 boolean containsJavaExecutableCode()
           
 boolean doesResourceExist(java.lang.String name)
          Always returns false, since it doesn't make sense for an XML artifact
 java.io.InputStream getInputStream()
           
 java.lang.String getName()
           
 java.io.InputStream getResourceAsStream(java.lang.String name)
          Always returns null, since it doesn't make sense for an XML artifact
 java.io.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(java.io.File xmlFile)
Method Detail

doesResourceExist

public boolean doesResourceExist(java.lang.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 java.io.InputStream getResourceAsStream(java.lang.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 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()
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

containsJavaExecutableCode

public boolean containsJavaExecutableCode()
Specified by:
containsJavaExecutableCode in interface PluginArtifact
Returns:
true if the plugin contains or references java executable code.


Copyright © 2013 Atlassian. All Rights Reserved.