1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.handler.codec.http;
17
18 import java.util.Collections;
19 import java.util.List;
20 import java.util.Map;
21 import java.util.Set;
22
23 import org.jboss.netty.buffer.ChannelBuffer;
24 import org.jboss.netty.buffer.ChannelBuffers;
25 import org.jboss.netty.channel.ChannelPipeline;
26
27
28
29
30
31
32
33
34
35
36 public interface HttpChunk {
37
38
39
40
41 HttpChunkTrailer LAST_CHUNK = new HttpChunkTrailer() {
42 public ChannelBuffer getContent() {
43 return ChannelBuffers.EMPTY_BUFFER;
44 }
45
46 public void setContent(ChannelBuffer content) {
47 throw new IllegalStateException("read-only");
48 }
49
50 public boolean isLast() {
51 return true;
52 }
53
54 @Deprecated
55 public void addHeader(String name, Object value) {
56 throw new IllegalStateException("read-only");
57 }
58
59 @Deprecated
60 public void clearHeaders() {
61
62 }
63
64 @Deprecated
65 public boolean containsHeader(String name) {
66 return false;
67 }
68
69 @Deprecated
70 public String getHeader(String name) {
71 return null;
72 }
73
74 @Deprecated
75 public Set<String> getHeaderNames() {
76 return Collections.emptySet();
77 }
78
79 @Deprecated
80 public List<String> getHeaders(String name) {
81 return Collections.emptyList();
82 }
83
84 @Deprecated
85 public List<Map.Entry<String, String>> getHeaders() {
86 return Collections.emptyList();
87 }
88
89 @Deprecated
90 public void removeHeader(String name) {
91
92 }
93
94 @Deprecated
95 public void setHeader(String name, Object value) {
96 throw new IllegalStateException("read-only");
97 }
98
99 @Deprecated
100 public void setHeader(String name, Iterable<?> values) {
101 throw new IllegalStateException("read-only");
102 }
103
104 public HttpHeaders trailingHeaders() {
105 return HttpHeaders.EMPTY_HEADERS;
106 }
107 };
108
109
110
111
112
113 boolean isLast();
114
115
116
117
118
119 ChannelBuffer getContent();
120
121
122
123
124
125 void setContent(ChannelBuffer content);
126 }