Clover coverage report - Cactus 1.4.1 for J2EE API 13
Coverage timestamp: Sat Aug 31 2002 22:02:23 BST
file stats: LOC: 67   Methods: 3
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
UrlUtil.java 50% 82.4% 66.7% 71.4%
 1   
 /*   Generated by AspectJ version 1.0.5 */
 2   
 package org.apache.cactus.util;
 3   
 import java.net.URL;
 4   
 
 5   
 /** 
 6   
  * Various utility methods for URL manipulation. 
 7   
  * 
 8   
  * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a> 
 9   
  * 
 10   
  * @version $Id: UrlUtil.html,v 1.1 2003/04/14 12:27:33 sinisa Exp $ 
 11   
  */
 12   
 public class UrlUtil {
 13   
   /** 
 14   
        * Returns the path part of the URL. This method is needed for 
 15   
        * JDK 1.2 support as <code>URL.getPath()</code> does not exist in 
 16   
        * JDK 1.2 (only for JDK 1.3+). 
 17   
        * 
 18   
        * @param theURL the URL from which to extract the path 
 19   
        * @return the path part of the URL 
 20   
        */
 21  660
   public static String getPath(URL theURL) {
 22  660
     String file = theURL.getFile();
 23  660
     String path = null;
 24  660
     if (file != null) {
 25  660
       int q = file.lastIndexOf('?');
 26  660
       if (q != -1) {
 27  660
         path = file.substring(0, q);
 28   
       } else {
 29  0
         path = file;
 30   
       } 
 31   
     } 
 32  660
     return path;
 33   
   } 
 34   
 
 35   
   /** 
 36   
        * Returns the query string of the URL. This method is needed for 
 37   
        * JDK 1.2 support as <code>URL.getQuery()</code> does not exist in 
 38   
        * JDK 1.2 (only for JDK 1.3+). 
 39   
        * 
 40   
        * @param theURL the URL from which to extract the query string 
 41   
        * @return the query string portion of the URL 
 42   
        */
 43  660
   public static String getQuery(URL theURL) {
 44  660
     String file = theURL.getFile();
 45  660
     String query = null;
 46  660
     if (file != null) {
 47  660
       int q = file.lastIndexOf('?');
 48  660
       if (q != -1) {
 49  660
         query = file.substring(q + 1);
 50   
       } else {
 51  0
         query = "";
 52   
       } 
 53   
     } 
 54  660
     return query;
 55   
   } 
 56   
 
 57   
   /** 
 58   
    * Various utility methods for URL manipulation. 
 59   
    * 
 60   
    * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a> 
 61   
    * 
 62   
    * @version $Id: UrlUtil.html,v 1.1 2003/04/14 12:27:33 sinisa Exp $ 
 63   
    */
 64  0
   public UrlUtil() {
 65  0
     super();
 66   
   } 
 67   
 }