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
37
38
39
40
41 public interface HttpChunk {
42
43
44
45
46 static HttpChunkTrailer LAST_CHUNK = new HttpChunkTrailer() {
47 public ChannelBuffer getContent() {
48 return ChannelBuffers.EMPTY_BUFFER;
49 }
50
51 public void setContent(ChannelBuffer content) {
52 throw new IllegalStateException("read-only");
53 }
54
55 public boolean isLast() {
56 return true;
57 }
58
59 public void addHeader(String name, Object value) {
60 throw new IllegalStateException("read-only");
61 }
62
63 public void clearHeaders() {
64
65 }
66
67 public boolean containsHeader(String name) {
68 return false;
69 }
70
71 public String getHeader(String name) {
72 return null;
73 }
74
75 public Set<String> getHeaderNames() {
76 return Collections.emptySet();
77 }
78
79 public List<String> getHeaders(String name) {
80 return Collections.emptyList();
81 }
82
83 public List<Map.Entry<String, String>> getHeaders() {
84 return Collections.emptyList();
85 }
86
87 public void removeHeader(String name) {
88
89 }
90
91 public void setHeader(String name, Object value) {
92 throw new IllegalStateException("read-only");
93 }
94
95 public void setHeader(String name, Iterable<?> values) {
96 throw new IllegalStateException("read-only");
97 }
98 };
99
100
101
102
103
104 boolean isLast();
105
106
107
108
109
110 ChannelBuffer getContent();
111
112
113
114
115
116 void setContent(ChannelBuffer content);
117 }