| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| RequestHeadersImpl |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 1999-2002,2004 The Apache Software Foundation. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package org.apache.commons.latka.http; | |
| 18 | ||
| 19 | import java.util.LinkedList; | |
| 20 | import java.util.List; | |
| 21 | ||
| 22 | /** | |
| 23 | * Implementation of {@link RequestHeaders} that stores its name-value pairs | |
| 24 | * in a list | |
| 25 | * | |
| 26 | * @author Morgran Delagrange | |
| 27 | * @author dIon Gillard | |
| 28 | * @version $Id: RequestHeadersImpl.java 155424 2005-02-26 13:09:29Z dirkv $ | |
| 29 | */ | |
| 30 | public class RequestHeadersImpl implements RequestHeaders { | |
| 31 | ||
| 32 | /** | |
| 33 | * The list of headers. Each element is a string array of two elements; | |
| 34 | * the header name and value. | |
| 35 | */ | |
| 36 | 0 | protected List _list = new LinkedList(); |
| 37 | ||
| 38 | /** | |
| 39 | * Protected access, headers can only be copied from | |
| 40 | * request to request. | |
| 41 | */ | |
| 42 | 0 | protected RequestHeadersImpl() { |
| 43 | 0 | } |
| 44 | ||
| 45 | /** | |
| 46 | * Defined in interface | |
| 47 | * @param headerName name of the header to be added | |
| 48 | * @param headerValue value of the header to be added | |
| 49 | * @see RequestHeaders#addHeader(String,String) | |
| 50 | */ | |
| 51 | public void addHeader(String headerName, String headerValue) { | |
| 52 | 0 | _list.add(new String[] { headerName, headerValue }); |
| 53 | 0 | } |
| 54 | ||
| 55 | /** | |
| 56 | * Defined in interface | |
| 57 | * @return a list of headers | |
| 58 | * @see RequestHeaders#getHeaders() | |
| 59 | */ | |
| 60 | public List getHeaders() { | |
| 61 | 0 | return _list; |
| 62 | } | |
| 63 | } |