Coverage report

  %line %branch
org.apache.jetspeed.container.url.impl.QueryStringEncodingPortalURL
0% 
0% 

 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  * 
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.jetspeed.container.url.impl;
 18  
 
 19  
 import javax.servlet.http.HttpServletRequest;
 20  
 
 21  
 import org.apache.jetspeed.PortalContext;
 22  
 import org.apache.jetspeed.container.state.NavigationalState;
 23  
 import org.apache.jetspeed.container.url.BasePortalURL;
 24  
 
 25  
 /**
 26  
  * QueryStringEncodingPortalURL encodes the NavigationalState as query parameter
 27  
  * *
 28  
  * @author <a href="mailto:ate@apache.org">Ate Douma</a>
 29  
  * @version $Id: QueryStringEncodingPortalURL.java 516448 2007-03-09 16:25:47Z ate $
 30  
  */
 31  
 public class QueryStringEncodingPortalURL extends AbstractPortalURL
 32  
 {
 33  
     public QueryStringEncodingPortalURL(NavigationalState navState, PortalContext portalContext, BasePortalURL base)
 34  
     {
 35  0
         super(navState, portalContext, base);
 36  0
     }
 37  
 
 38  
     public QueryStringEncodingPortalURL(NavigationalState navState, PortalContext portalContext)
 39  
     {
 40  0
         super(navState, portalContext);
 41  0
     }
 42  
 
 43  
     public QueryStringEncodingPortalURL(String characterEncoding, NavigationalState navState, PortalContext portalContext)
 44  
     {
 45  0
         super(characterEncoding, navState, portalContext);
 46  0
     }
 47  
 
 48  
     public QueryStringEncodingPortalURL(HttpServletRequest request, String characterEncoding, NavigationalState navState, PortalContext portalContext)
 49  
     {
 50  0
         super(request, characterEncoding, navState, portalContext);
 51  0
     }
 52  
 
 53  
     protected void decodePathAndNavigationalState(HttpServletRequest request)
 54  
     {
 55  0
         setEncodedNavigationalState(request.getParameter(getNavigationalStateParameterName()));
 56  0
         String path = null;
 57  0
         if (request.getPathInfo() != null)
 58  
         {
 59  0
             path = request.getPathInfo();
 60  0
             int length = path.length();
 61  0
             if ( length > 1 && path.endsWith("/") )
 62  
             {
 63  0
                 path = path.substring(0, length-1);
 64  
             }
 65  
         }
 66  0
         setPath(path);
 67  0
     }
 68  
     
 69  
     protected String createPortletURL(String encodedNavigationalState, boolean secure)
 70  
     {
 71  0
         StringBuffer buffer = new StringBuffer(getBaseURL(secure));
 72  0
         buffer.append(getBasePath());
 73  0
         if ( getPath() != null )
 74  
         {
 75  0
             buffer.append(getPath());
 76  
         }
 77  0
         if ( encodedNavigationalState != null )
 78  
         {
 79  0
             buffer.append("?");
 80  0
             buffer.append(getNavigationalStateParameterName());
 81  0
             buffer.append("=");
 82  0
             buffer.append(encodedNavigationalState);
 83  
         }
 84  0
         return buffer.toString();
 85  
     }    
 86  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.