1 17 18 19 package org.apache.catalina.authenticator; 20 21 22 import java.util.ArrayList ; 23 import java.util.HashMap ; 24 import java.util.Iterator ; 25 import java.util.Locale ; 26 27 import javax.servlet.http.Cookie ; 28 29 import org.apache.tomcat.util.buf.ByteChunk; 30 31 32 44 45 public final class SavedRequest { 46 47 48 51 private ArrayList cookies = new ArrayList (); 52 53 public void addCookie(Cookie cookie) { 54 cookies.add(cookie); 55 } 56 57 public Iterator getCookies() { 58 return (cookies.iterator()); 59 } 60 61 62 68 private HashMap headers = new HashMap (); 69 70 public void addHeader(String name, String value) { 71 ArrayList values = (ArrayList ) headers.get(name); 72 if (values == null) { 73 values = new ArrayList (); 74 headers.put(name, values); 75 } 76 values.add(value); 77 } 78 79 public Iterator getHeaderNames() { 80 return (headers.keySet().iterator()); 81 } 82 83 public Iterator getHeaderValues(String name) { 84 ArrayList values = (ArrayList ) headers.get(name); 85 if (values == null) 86 return ((new ArrayList ()).iterator()); 87 else 88 return (values.iterator()); 89 } 90 91 92 95 private ArrayList locales = new ArrayList (); 96 97 public void addLocale(Locale locale) { 98 locales.add(locale); 99 } 100 101 public Iterator getLocales() { 102 return (locales.iterator()); 103 } 104 105 106 109 private String method = null; 110 111 public String getMethod() { 112 return (this.method); 113 } 114 115 public void setMethod(String method) { 116 this.method = method; 117 } 118 119 120 121 126 private HashMap parameters = new HashMap (); 127 128 public void addParameter(String name, String values[]) { 129 parameters.put(name, values); 130 } 131 132 public Iterator getParameterNames() { 133 return (parameters.keySet().iterator()); 134 } 135 136 public String [] getParameterValues(String name) { 137 return ((String []) parameters.get(name)); 138 } 139 140 141 144 private String queryString = null; 145 146 public String getQueryString() { 147 return (this.queryString); 148 } 149 150 public void setQueryString(String queryString) { 151 this.queryString = queryString; 152 } 153 154 155 158 private String requestURI = null; 159 160 public String getRequestURI() { 161 return (this.requestURI); 162 } 163 164 public void setRequestURI(String requestURI) { 165 this.requestURI = requestURI; 166 } 167 168 169 172 private ByteChunk body = null; 173 174 public ByteChunk getBody() { 175 return (this.body); 176 } 177 178 public void setBody(ByteChunk body) { 179 this.body = body; 180 } 181 } 182 | Popular Tags |