cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/acting HttpHeaderAction.java
Date Wed, 13 Mar 2002 10:36:39 GMT
cziegeler    02/03/13 02:36:39

  Modified:    src/java/org/apache/cocoon/acting HttpHeaderAction.java
  Log:
  Formatted code
  
  Revision  Changes    Path
  1.7       +23 -19    xml-cocoon2/src/java/org/apache/cocoon/acting/HttpHeaderAction.java
  
  Index: HttpHeaderAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/HttpHeaderAction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HttpHeaderAction.java	22 Feb 2002 06:59:26 -0000	1.6
  +++ HttpHeaderAction.java	13 Mar 2002 10:36:39 -0000	1.7
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.acting;
   
  -import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.parameters.Parameters;
  @@ -68,40 +67,45 @@
    * This action adds HTTP headers to the response.
    *
    * @author <a href="mailto:balld@apache.org">Donald Ball</a>
  - * @version CVS $Id: HttpHeaderAction.java,v 1.6 2002/02/22 06:59:26 cziegeler Exp $
  + * @version CVS $Id: HttpHeaderAction.java,v 1.7 2002/03/13 10:36:39 cziegeler Exp $
    */
  -public class HttpHeaderAction extends AbstractConfigurableAction implements ThreadSafe,
Configurable {
  +public class HttpHeaderAction
  +extends AbstractConfigurableAction
  +implements ThreadSafe {
   
       private static Object[] defaults = {};
   
       public void configure(Configuration conf) throws ConfigurationException {
           if (conf != null) {
  -        String[] names = {};
  -        super.configure(conf);
  -        defaults=(settings.keySet()).toArray();
  -    };
  +            String[] names = {};
  +            super.configure(conf);
  +            defaults=(settings.keySet()).toArray();
  +        }
       }
   
  -    public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String
source, Parameters parameters) throws Exception {
  +    public Map act(Redirector redirector, SourceResolver resolver,
  +                   Map objectModel, String source, Parameters parameters)
  +    throws Exception {
           Map results = new HashMap();
  -    HashMap isDone = new HashMap();
  -    Integer dummy = new Integer(1);
  +        HashMap isDone = new HashMap();
  +        Integer dummy = new Integer(1);
   
  -        Response response = ObjectModelHelper.getResponse(objectModel);
  -        String[] names = parameters.getNames();
  +        final Response response = ObjectModelHelper.getResponse(objectModel);
  +        final String[] names = parameters.getNames();
   
  -    // parameters
  +        // parameters
           for (int i=0; i<names.length; i++) {
  -        isDone.put(names[i], dummy);
  +            isDone.put(names[i], dummy);
               response.setHeader(names[i],parameters.getParameter(names[i]));
               results.put(names[i],parameters.getParameter(names[i]));
           }
  -    // defaults, that are not overridden
  +
  +        // defaults, that are not overridden
           for (int i=0; i<defaults.length; i++) {
  -        if (! isDone.containsKey(defaults[i])) {
  -        response.setHeader((String) defaults[i], (String) settings.get(defaults[i]));
  -        results.put((String) defaults[i],(String) settings.get(defaults[i]));
  -        }
  +            if (! isDone.containsKey(defaults[i])) {
  +                response.setHeader((String) defaults[i], (String) settings.get(defaults[i]));
  +                results.put((String) defaults[i],(String) settings.get(defaults[i]));
  +            }
           }
   
           return Collections.unmodifiableMap(results);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message