1
2
3
4
5
6
7 package com.atlassian.bonnie.search;
8
9 import java.io.InputStream;
10 import java.io.IOException;
11
12 import com.atlassian.core.util.ClassLoaderUtils;
13
14 public class MockSearchableAttachment extends MockSearchableObject implements SearchableAttachment
15 {
16 String contentType;
17 String fileName;
18 String comment;
19 String niceType;
20 String niceFileSize;
21 String downloadPath;
22
23 public String getNiceType()
24 {
25 return niceType;
26 }
27
28 public void setNiceType(String niceType)
29 {
30 this.niceType = niceType;
31 }
32
33 public String getNiceFileSize()
34 {
35 return niceFileSize;
36 }
37
38 public void setNiceFileSize(String niceFileSize)
39 {
40 this.niceFileSize = niceFileSize;
41 }
42
43 public String getDownloadPath()
44 {
45 return downloadPath;
46 }
47
48 public void setDownloadPath(String downloadPath)
49 {
50 this.downloadPath = downloadPath;
51 }
52
53 public String getContentType()
54 {
55 return contentType;
56 }
57
58 public void setContentType(String contentType)
59 {
60 this.contentType = contentType;
61 }
62
63 public String getFileName()
64 {
65 return fileName;
66 }
67
68 public void setFileName(String fileName)
69 {
70 this.fileName = fileName;
71 }
72
73 public InputStream getContentsAsStream() throws IOException
74 {
75 return ClassLoaderUtils.getResourceAsStream(fileName, getClass());
76 }
77
78 public String getComment()
79 {
80 return comment;
81 }
82
83 public void setComment(String comment)
84 {
85 this.comment = comment;
86 }
87 }