KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portletcontainer > impl > portletAPIImp > PortletResponseImp


1 /**
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

5
6 /**
7  * Created by The eXo Platform SARL
8  * Author : Mestrallet Benjamin
9  * benjmestrallet@users.sourceforge.net
10  * Date: Jul 28, 2003
11  * Time: 10:18:25 PM
12  */

13 package org.exoplatform.services.portletcontainer.impl.portletAPIImp;
14
15
16 import java.util.List JavaDoc;
17
18 import javax.portlet.PortletResponse;
19 import javax.servlet.http.HttpServletResponse JavaDoc;
20 import javax.servlet.http.HttpServletResponseWrapper JavaDoc;
21 import org.exoplatform.services.portletcontainer.pci.Output;
22
23
24 public class PortletResponseImp extends HttpServletResponseWrapper JavaDoc
25     implements PortletResponse {
26
27   protected List JavaDoc customWindowStates;
28   private Output output;
29
30   public PortletResponseImp(HttpServletResponse JavaDoc httpServletResponse) {
31     super(httpServletResponse);
32   }
33
34   public void fillPortletResponse(HttpServletResponse JavaDoc response,
35                                   Output output,
36                                   List JavaDoc customWindowStates) {
37     super.setResponse(response);
38     this.output = output;
39     this.customWindowStates = customWindowStates;
40   }
41
42   public void emptyPortletResponse() {
43   }
44
45   public Output getOutput() {
46     return output;
47   }
48
49   public void addProperty(String JavaDoc s, String JavaDoc s1) {
50     output.addProperty(s, s1);
51   }
52
53   public void setProperty(String JavaDoc s, String JavaDoc s1) {
54     output.addProperty(s, s1);
55   }
56
57   public String JavaDoc encodeURL(String JavaDoc path) {
58     if (!path.startsWith("/") && !path.startsWith("http://")) {
59       throw new IllegalArgumentException JavaDoc("Path must be started with / or http://") ;
60     }
61     return path;
62   }
63   
64 }
65
Popular Tags