1 5 6 package com.raptus.owxv3.api; 7 8 9 31 public class GResURL extends Object 32 { 33 36 protected int urlRowID = -1; 37 38 41 protected String fname = null; 42 43 46 protected String url = null; 47 48 49 50 51 54 public int getRowID() { return urlRowID; } 55 public void setRowID(int id) { this.urlRowID = id; } 56 57 public String getProtocol() { return fname; } 58 public void setProtocol(String p) { this.fname = p; } 59 60 public String getURL() { return url; } 61 public void setURL(String h) { this.url = h; } 62 63 64 65 66 67 68 71 public void setFullURL(String u) 72 { 73 if(u != null) 74 { 75 if(u.indexOf("@") != -1) 76 { 77 setProtocol("mailto:"); 79 setURL(u); 80 } 81 else 82 { 83 int prtHstSep = u.indexOf("://"); 85 if(prtHstSep != -1) 86 { 87 setProtocol( u.substring(0, prtHstSep) + "://"); 88 setURL( u.substring(prtHstSep+3) ); 89 } 90 else 91 { 92 setProtocol("http://"); 93 setURL(u); 94 } 95 } 96 } 97 } 98 99 102 public String getDisplayedURL() 103 { 104 if(url.length() > 40) 105 return url.substring(0, 10) + " ... " + url.substring(url.length() - 10); 106 107 return url; 108 } 109 } 110 111 112 | Popular Tags |