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