Lines Matching refs:url

64         // bug 762454: strip period off end of url
74 Log.v(LOGTAG, "smartUrlFilter: failed to parse url = " + inUrl);
111 public static byte[] decode(byte[] url) throws IllegalArgumentException {
112 if (url.length == 0) {
117 byte[] tempData = new byte[url.length];
120 for (int i = 0; i < url.length; i++) {
121 byte b = url[i];
123 if (url.length - i > 2) {
124 b = (byte) (parseHex(url[i + 1]) * 16
125 + parseHex(url[i + 2]));
139 * @return True iff the url is correctly URL encoded
141 static boolean verifyURLEncoding(String url) {
142 int count = url.length();
147 int index = url.indexOf('%');
151 parseHex((byte) url.charAt(++index));
152 parseHex((byte) url.charAt(++index));
159 index = url.indexOf('%', index + 1);
173 * @return True iff the url is an asset file.
175 public static boolean isAssetUrl(String url) {
176 return (null != url) && url.startsWith(ASSET_BASE);
180 * @return True iff the url is a resource file.
183 public static boolean isResourceUrl(String url) {
184 return (null != url) && url.startsWith(RESOURCE_BASE);
188 * @return True iff the url is a proxy url to allow cookieless network
189 * requests from a file url.
193 public static boolean isCookielessProxyUrl(String url) {
194 return (null != url) && url.startsWith(PROXY_BASE);
198 * @return True iff the url is a local file.
200 public static boolean isFileUrl(String url) {
201 return (null != url) && (url.startsWith(FILE_BASE) &&
202 !url.startsWith(ASSET_BASE) &&
203 !url.startsWith(PROXY_BASE));
207 * @return True iff the url is an about: url.
209 public static boolean isAboutUrl(String url) {
210 return (null != url) && url.startsWith("about:");
214 * @return True iff the url is a data: url.
216 public static boolean isDataUrl(String url) {
217 return (null != url) && url.startsWith("data:");
221 * @return True iff the url is a javascript: url.
223 public static boolean isJavaScriptUrl(String url) {
224 return (null != url) && url.startsWith("javascript:");
228 * @return True iff the url is an http: url.
230 public static boolean isHttpUrl(String url) {
231 return (null != url) &&
232 (url.length() > 6) &&
233 url.substring(0, 7).equalsIgnoreCase("http://");
237 * @return True iff the url is an https: url.
239 public static boolean isHttpsUrl(String url) {
240 return (null != url) &&
241 (url.length() > 7) &&
242 url.substring(0, 8).equalsIgnoreCase("https://");
246 * @return True iff the url is a network url.
248 public static boolean isNetworkUrl(String url) {
249 if (url == null || url.length() == 0) {
252 return isHttpUrl(url) || isHttpsUrl(url);
256 * @return True iff the url is a content: url.
258 public static boolean isContentUrl(String url) {
259 return (null != url) && url.startsWith(CONTENT_BASE);
263 * @return True iff the url is valid.
265 public static boolean isValidUrl(String url) {
266 if (url == null || url.length() == 0) {
270 return (isAssetUrl(url) ||
271 isResourceUrl(url) ||
272 isFileUrl(url) ||
273 isAboutUrl(url) ||
274 isHttpUrl(url) ||
275 isHttpsUrl(url) ||
276 isJavaScriptUrl(url) ||
277 isContentUrl(url));
281 * Strips the url of the anchor.
283 public static String stripAnchor(String url) {
284 int anchorIndex = url.indexOf('#');
286 return url.substring(0, anchorIndex);
288 return url;
295 * @param url Url to the content
302 String url,
321 String decodedUrl = Uri.decode(url);