1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kew.mail.service.impl;
18 import java.util.List;
19 import javax.mail.Address;
20 import javax.mail.internet.AddressException;
21 import javax.mail.internet.InternetAddress;
22
23
24
25
26
27
28 public class EmailCcList {
29
30 private List<String> ccAddresses;
31
32 public EmailCcList(List<String> ccAddresses) {
33 this.ccAddresses = ccAddresses;
34 }
35
36 public List<String> getCcAddresses() {
37 return ccAddresses;
38 }
39
40 public Address[] getToAddressesAsAddressArray() throws AddressException {
41 Address[] recipientAddresses = new Address[this.ccAddresses.size()];
42 for (int i = 0; i < recipientAddresses.length; i++) {
43 recipientAddresses[i] = new InternetAddress((String) this.ccAddresses.get(i));
44 }
45 return recipientAddresses;
46 }
47
48 public void setCcAddress(List<String> ccAddresses) {
49 this.ccAddresses = ccAddresses;
50 }
51
52 }