Clover coverage report - Cactus 1.4 for J2EE API 12
Coverage timestamp: Sun Aug 25 2002 18:00:03 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.java,v 1.1.2.1 2002/08/08 21:50:05 vmassol 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  354
   public static String getPath(URL theURL) {
 22  354
     String file = theURL.getFile();
 23  354
     String path = null;
 24  354
     if (file != null) {
 25  354
       int q = file.lastIndexOf('?');
 26  354
       if (q != -1) {
 27  354
         path = file.substring(0, q);
 28   
       } else {
 29  0
         path = file;
 30   
       } 
 31   
     } 
 32  354
     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  354
   public static String getQuery(URL theURL) {
 44  354
     String file = theURL.getFile();
 45  354
     String query = null;
 46  354
     if (file != null) {
 47  354
       int q = file.lastIndexOf('?');
 48  354
       if (q != -1) {
 49  354
         query = file.substring(q + 1);
 50   
       } else {
 51  0
         query = "";
 52   
       } 
 53   
     } 
 54  354
     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.java,v 1.1.2.1 2002/08/08 21:50:05 vmassol Exp $ 
 63   
    */
 64  0
   public UrlUtil() {
 65  0
     super();
 66   
   } 
 67   
 }