1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package davmail.exchange.ews;
20
21 import java.io.IOException;
22 import java.io.Writer;
23
24
25
26
27 public class FileAttachment {
28 protected String name;
29 protected String contentType;
30 protected String content;
31 protected String attachmentId;
32 protected boolean isContactPhoto;
33
34
35
36
37 public FileAttachment() {
38
39 }
40
41
42
43
44
45
46
47
48 public FileAttachment(String name, String contentType, String content) {
49 this.name = name;
50 this.contentType = contentType;
51 this.content = content;
52 }
53
54
55
56
57
58
59
60 public void write(Writer writer) throws IOException {
61 writer.write("<t:FileAttachment>");
62 if (name != null) {
63 writer.write("<t:Name>");
64 writer.write(name);
65 writer.write("</t:Name>");
66 }
67 if (contentType != null) {
68 writer.write("<t:ContentType>");
69 writer.write(contentType);
70 writer.write("</t:ContentType>");
71 }
72 if (isContactPhoto) {
73 writer.write("<t:IsContactPhoto>true</t:IsContactPhoto>");
74 }
75 if (content != null) {
76 writer.write("<t:Content>");
77 writer.write(content);
78 writer.write("</t:Content>");
79 }
80 writer.write("</t:FileAttachment>");
81 }
82
83
84
85
86
87
88 public void setIsContactPhoto(boolean isContactPhoto) {
89 this.isContactPhoto = isContactPhoto;
90 }
91
92 }