Home | History | Annotate | Download | only in message

Lines Matching refs:Header

38 import org.apache.http.Header;
71 * Adds the given header to the group. The order in which this header was
74 * @param header the header to add
76 public void addHeader(Header header) {
77 if (header == null) {
80 headers.add(header);
84 * Removes the given header.
86 * @param header the header to remove
88 public void removeHeader(Header header) {
89 if (header == null) {
92 headers.remove(header);
96 * Replaces the first occurence of the header with the same name. If no header with
97 * the same name is found the given header is added to the end of the list.
99 * @param header the new header that should replace the first header with the same
102 public void updateHeader(Header header) {
103 if (header == null) {
107 Header current = (Header) this.headers.get(i);
108 if (current.getName().equalsIgnoreCase(header.getName())) {
109 this.headers.set(i, header);
113 this.headers.add(header);
123 public void setHeaders(Header[] headers) {
134 * Gets a header representing all of the header values with the given name.
135 * If more that one header with the given name exists the values will be
138 * <p>Header name comparison is case insensitive.
140 * @param name the name of the header(s) to get
141 * @return a header with a condensed value or <code>null</code> if no
144 public Header getCondensedHeader(String name) {
145 Header[] headers = getHeaders(name);
167 * <p>Header name comparison is case insensitive.
169 * @param name the name of the header(s) to get
173 public Header[] getHeaders(String name) {
177 Header header = (Header) headers.get(i);
178 if (header.getName().equalsIgnoreCase(name)) {
179 headersFound.add(header);
183 return (Header[]) headersFound.toArray(new Header[headersFound.size()]);
187 * Gets the first header with the given name.
189 * <p>Header name comparison is case insensitive.
191 * @param name the name of the header to get
192 * @return the first header or <code>null</code>
194 public Header getFirstHeader(String name) {
196 Header header = (Header) headers.get(i);
197 if (header.getName().equalsIgnoreCase(name)) {
198 return header;
205 * Gets the last header with the given name.
207 * <p>Header name comparison is case insensitive.
209 * @param name the name of the header to get
210 * @return the last header or <code>null</code>
212 public Header getLastHeader(String name) {
215 Header header = (Header) headers.get(i);
216 if (header.getName().equalsIgnoreCase(name)) {
217 return header;
229 public Header[] getAllHeaders() {
230 return (Header[]) headers.toArray(new Header[headers.size()]);
236 * <p>Header name comparison is case insensitive.
238 * @param name the header name to test for
239 * @return <code>true</code> if at least one header with the name is
244 Header header = (Header) headers.get(i);
245 if (header.getName().equalsIgnoreCase(name)) {