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