KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > cocoon > ContentTypeStep


1 package org.sapia.soto.state.cocoon;
2
3 import org.apache.commons.lang.ClassUtils;
4
5 import org.sapia.soto.state.Result;
6 import org.sapia.soto.state.Step;
7
8
9 /**
10  * @author Yanick Duchesne
11  *
12  * <dl>
13  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
14  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
15  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
16  * </dl>
17  */

18 public class ContentTypeStep implements Step {
19   public static final String JavaDoc DEFAULT_CONTENT_TYPE = "text/xml";
20   private String JavaDoc _contentType = DEFAULT_CONTENT_TYPE;
21
22   /**
23    * @see org.sapia.soto.state.Executable#execute(org.sapia.soto.state.Result)
24    */

25   public void execute(Result st) {
26     ((CocoonContext) st.getContext()).getResponse().setHeader("Content-Type",
27       _contentType);
28   }
29
30   /**
31    * @see org.sapia.soto.state.Step#getName()
32    */

33   public String JavaDoc getName() {
34     return ClassUtils.getShortClassName(getClass());
35   }
36
37   public void setType(String JavaDoc ct) {
38     _contentType = ct;
39   }
40 }
41
Popular Tags