KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portletcontainer > impl > portletAPIImp > utils > CustomRequestWrapperUtil


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 29, 2003
11  * Time: 11:49:38 AM
12  */

13 package org.exoplatform.services.portletcontainer.impl.portletAPIImp.utils;
14
15 public class CustomRequestWrapperUtil {
16
17   private static final char SEPARATOR = '$';
18
19   public static String JavaDoc decodeRequestAttribute(String JavaDoc windowId, String JavaDoc attributeName) {
20     if (attributeName.startsWith(windowId + SEPARATOR)) {
21       int index = attributeName.indexOf(SEPARATOR);
22       if (index > -1) {
23         attributeName = attributeName.substring(index + 1);
24       }
25     }
26     return attributeName;
27   }
28
29   public static String JavaDoc encodeAttribute(String JavaDoc windowId, String JavaDoc attributeName) {
30     if(attributeName.startsWith("javax."))
31       return attributeName;
32     StringBuffer JavaDoc sB = new StringBuffer JavaDoc();
33     sB.append(windowId);
34     sB.append(SEPARATOR);
35     sB.append(attributeName);
36     return sB.toString();
37   }
38
39 }
40
Popular Tags