1 package org.apache.turbine.util.uri; 2 3 18 19 import org.apache.turbine.util.RunData; 20 import org.apache.turbine.util.ServerData; 21 22 34 35 public class DataURI 36 extends BaseURI 37 implements URIConstants 38 { 39 43 public DataURI() 44 { 45 super(); 46 } 47 48 53 public DataURI(RunData runData) 54 { 55 super(runData); 56 } 57 58 64 public DataURI(RunData runData, boolean redirect) 65 { 66 super(runData, redirect); 67 } 68 69 74 public DataURI(ServerData serverData) 75 { 76 super(serverData); 77 } 78 79 85 public DataURI(ServerData serverData, boolean redirect) 86 { 87 super(serverData, redirect); 88 } 89 90 91 96 public void clearResponse() 97 { 98 setResponse(null); 99 } 100 101 120 public String getAbsoluteLink() 121 { 122 StringBuffer output = new StringBuffer (); 123 124 getSchemeAndPort(output); 125 getContextAndScript(output); 126 127 if (hasReference()) 128 { 129 output.append('#'); 130 output.append(getReference()); 131 } 132 133 return encodeResponse(output.toString()); 137 } 138 139 158 public String getRelativeLink() 159 { 160 StringBuffer output = new StringBuffer (); 161 162 getContextAndScript(output); 163 164 if (hasReference()) 165 { 166 output.append('#'); 167 output.append(getReference()); 168 } 169 170 return encodeResponse(output.toString()); 174 } 175 176 183 public String toString() 184 { 185 return getAbsoluteLink(); 186 } 187 } 188 | Popular Tags |