1 package com.atlassian.plugin;
2
3 import java.io.*;
4
5
6
7
8
9
10 public class XmlPluginArtifact implements PluginArtifact
11 {
12 private final File xmlFile;
13
14 public XmlPluginArtifact(File xmlFile)
15 {
16 this.xmlFile = xmlFile;
17 }
18
19
20
21
22 public boolean doesResourceExist(String name)
23 {
24 return false;
25 }
26
27
28
29
30 public InputStream getResourceAsStream(String name) throws PluginParseException
31 {
32 return null;
33 }
34
35 public String getName()
36 {
37 return xmlFile.getName();
38 }
39
40
41
42
43
44 public InputStream getInputStream()
45 {
46 try
47 {
48 return new BufferedInputStream(new FileInputStream(xmlFile));
49 }
50 catch (FileNotFoundException e)
51 {
52 throw new RuntimeException("Could not find XML file for eading: " + xmlFile, e);
53 }
54 }
55
56 public File toFile()
57 {
58 return xmlFile;
59 }
60 }