Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 
 package org.apache.catalina.authenticator;
 
 
 
 
Object that saves the critical information from a request so that form-based authentication can reproduce it once the user has been authenticated.

IMPLEMENTATION NOTE - It is assumed that this object is accessed only from the context of a single thread, so no synchronization around internal collection classes is performed.

Author(s):
Craig R. McClanahan
Version:
$Revision: 515 $ $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
 
 
 public final class SavedRequest {


    
The set of Cookies associated with this Request.
 
     private ArrayList<Cookiecookies = new ArrayList<Cookie>();
 
     public void addCookie(Cookie cookie) {
         .add(cookie);
     }
 
     public Iterator getCookies() {
         return (.iterator());
     }


    
The set of Headers associated with this Request. Each key is a header name, while the value is a ArrayList containing one or more actual values for this header. The values are returned as an Iterator when you ask for them.
 
     private HashMap<String,ArrayList<String>> headers =
         new HashMap<String,ArrayList<String>>();
 
     public void addHeader(String nameString value) {
         ArrayList<Stringvalues = (ArrayList<String>) .get(name);
         if (values == null) {
             values = new ArrayList<String>();
             .put(namevalues);
         }
         values.add(value);
     }
 
     public Iterator getHeaderNames() {
         return (.keySet().iterator());
     }
 
     public Iterator getHeaderValues(String name) {
         ArrayList values = (ArrayList.get(name);
         if (values == null)
             return ((new ArrayList()).iterator());
         else
             return (values.iterator());
     }


    
The set of Locales associated with this Request.
 
     private ArrayList<Localelocales = new ArrayList<Locale>();
 
     public void addLocale(Locale locale) {
         .add(locale);
    }
    public Iterator getLocales() {
        return (.iterator());
    }


    
The request method used on this Request.
    private String method = null;
    public String getMethod() {
        return (this.);
    }
    public void setMethod(String method) {
        this. = method;
    }



    
The set of request parameters associated with this Request. Each entry is keyed by the parameter name, pointing at a String array of the corresponding values.
    private HashMap<String,String[]> parameters =
        new HashMap<String,String[]>();
    public void addParameter(String nameString values[]) {
        .put(namevalues);
    }
    public Iterator getParameterNames() {
        return (.keySet().iterator());
    }
    public String[] getParameterValues(String name) {
        return ((String[]) .get(name));
    }


    
The query string associated with this Request.
    private String queryString = null;
    public String getQueryString() {
        return (this.);
    }
    public void setQueryString(String queryString) {
        this. = queryString;
    }


    
The request URI associated with this Request.
    private String requestURI = null;
    public String getRequestURI() {
        return (this.);
    }
    public void setRequestURI(String requestURI) {
        this. = requestURI;
    }

    
    
The decoded request URI associated with this Request.
    private String decodedRequestURI = null;
    public String getDecodedRequestURI() {
        return (this.);
    }
    public void setDecodedRequestURI(String decodedRequestURI) {
        this. = decodedRequestURI;
    }

    
    
The body of this request.
    private ByteChunk body = null;
    
    public ByteChunk getBody() {
        return (this.);
    }
    public void setBody(ByteChunk body) {
        this. = body;
    }
    
    
The content type of the request, used if this is a POST.
    private String contentType = null;
    
    public String getContentType() {
        return (this.);
    }
    
    public void setContentType(String contentType) {
        this. = contentType;
    }
New to GrepCode? Check out our FAQ X