1 20 package org.enhydra.barracuda.plankton.http; 21 22 import java.io.*; 23 import java.util.*; 24 import javax.servlet.*; 25 import javax.servlet.http.*; 26 27 28 31 public class LightweightURL { 32 String url = null; 33 String base = null; 34 String param = null; 35 36 41 public LightweightURL(String iurl) { 42 url = iurl; 43 } 44 45 49 public String getURLStr() { 50 if (url==null) return ""; 51 return url; 52 } 53 54 58 public String getBaseStr() { 59 if (url==null) return ""; 60 if (base==null) { 61 int epos = url.indexOf("?"); 62 if (epos>-1) base = url.substring(0,epos); 63 else base = url; 64 } 65 return base; 66 } 67 68 72 public String getParamStr() { 73 if (url==null) return ""; 74 if (param==null) { 75 int spos = url.indexOf("?"); 76 if (spos>-1) param = url.substring(spos); 77 else param = ""; 78 } 79 return param; 80 } 81 82 85 public String toString() { 86 return url; 87 } 88 } 89 | Popular Tags |