root / src / messages / MessageForwarder.java
History | View | Annotate | Download (525 Bytes)
1 | 1 | up20150524 | package messages; |
---|---|---|---|
2 | |||
3 | public class MessageForwarder { |
||
4 | |||
5 | public static void sendMessage(Message message){ |
||
6 | Thread th = new Thread(new SendMessage(message)); |
||
7 | th.start(); |
||
8 | } |
||
9 | |||
10 | public static String addHeader(String type, String[] params) { |
||
11 | StringBuilder result = new StringBuilder(); |
||
12 | |||
13 | for (String param : params) { |
||
14 | result.append(param); |
||
15 | result.append(" ");
|
||
16 | } |
||
17 | |||
18 | return type + " " + |
||
19 | result.toString() + |
||
20 | "\r\n\r\n";
|
||
21 | } |
||
22 | } |