01: package vicazh.hyperpool.stream.net.http.html;
02:
03: import java.io.*;
04: import java.text.*;
05: import java.util.*;
06: import vicazh.hyperpool.Start;
07: import vicazh.hyperpool.stream.net.http.*;
08:
09: public class MessageStream extends ClientStream {
10: public MessageStream() {
11: }
12:
13: MessageStream(Session session) throws IOException {
14: super (session, null);
15: outputstream = new XMLService(this ).get(connection.getServer());
16: }
17:
18: private String text;
19:
20: public String getText() {
21: return text;
22: }
23:
24: public void setText(String text) {
25: this .text = text;
26: }
27:
28: private String title;
29:
30: public String getTitle() {
31: return title;
32: }
33:
34: public void setTitle(String title) {
35: this .title = title;
36: }
37:
38: private String name;
39:
40: public String getName() {
41: return name;
42: }
43:
44: public void setName(String name) {
45: this .name = name;
46: }
47:
48: private String version;
49:
50: public String getVersion() {
51: return version;
52: }
53:
54: public void setVersion(String version) {
55: this .version = version;
56: }
57:
58: private String time;
59:
60: public String getTime() {
61: return time;
62: }
63:
64: public void setTime(String time) {
65: this .time = time;
66: }
67:
68: public void head(String method, String file, String version)
69: throws IOException {
70: super .head(method, ((MessageService) connection.element)
71: .getUrl(), version);
72: }
73:
74: public void header() throws IOException {
75: name = Start.NAME;
76: version = Start.VERSION;
77: Locale locale = getLocale();
78: time = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,
79: DateFormat.DEFAULT, locale).format(new Date());
80: title = ResourceBundle.getBundle(
81: ((MessageService) connection.element).base, locale,
82: ((MessageService) connection.element).loader)
83: .getString("message");
84: text = ((MessageService) connection.element).getText();
85: super.header();
86: }
87:
88: }
|