Lines Matching refs:url

61         // bug 762454: strip period off end of url
71 Log.v(LOGTAG, "smartUrlFilter: failed to parse url = " + inUrl);
108 public static byte[] decode(byte[] url) throws IllegalArgumentException {
109 if (url.length == 0) {
114 byte[] tempData = new byte[url.length];
117 for (int i = 0; i < url.length; i++) {
118 byte b = url[i];
120 if (url.length - i > 2) {
121 b = (byte) (parseHex(url[i + 1]) * 16
122 + parseHex(url[i + 2]));
136 * @return True iff the url is correctly URL encoded
138 static boolean verifyURLEncoding(String url) {
139 int count = url.length();
144 int index = url.indexOf('%');
148 parseHex((byte) url.charAt(++index));
149 parseHex((byte) url.charAt(++index));
156 index = url.indexOf('%', index + 1);
170 * @return True iff the url is an asset file.
172 public static boolean isAssetUrl(String url) {
173 return (null != url) && url.startsWith(ASSET_BASE);
177 * @return True iff the url is a resource file.
180 public static boolean isResourceUrl(String url) {
181 return (null != url) && url.startsWith(RESOURCE_BASE);
185 * @return True iff the url is an proxy url to allow cookieless network
186 * requests from a file url.
190 public static boolean isCookielessProxyUrl(String url) {
191 return (null != url) && url.startsWith(PROXY_BASE);
195 * @return True iff the url is a local file.
197 public static boolean isFileUrl(String url) {
198 return (null != url) && (url.startsWith(FILE_BASE) &&
199 !url.startsWith(ASSET_BASE) &&
200 !url.startsWith(PROXY_BASE));
204 * @return True iff the url is an about: url.
206 public static boolean isAboutUrl(String url) {
207 return (null != url) && url.startsWith("about:");
211 * @return True iff the url is a data: url.
213 public static boolean isDataUrl(String url) {
214 return (null != url) && url.startsWith("data:");
218 * @return True iff the url is a javascript: url.
220 public static boolean isJavaScriptUrl(String url) {
221 return (null != url) && url.startsWith("javascript:");
225 * @return True iff the url is an http: url.
227 public static boolean isHttpUrl(String url) {
228 return (null != url) &&
229 (url.length() > 6) &&
230 url.substring(0, 7).equalsIgnoreCase("http://");
234 * @return True iff the url is an https: url.
236 public static boolean isHttpsUrl(String url) {
237 return (null != url) &&
238 (url.length() > 7) &&
239 url.substring(0, 8).equalsIgnoreCase("https://");
243 * @return True iff the url is a network url.
245 public static boolean isNetworkUrl(String url) {
246 if (url == null || url.length() == 0) {
249 return isHttpUrl(url) || isHttpsUrl(url);
253 * @return True iff the url is a content: url.
255 public static boolean isContentUrl(String url) {
256 return (null != url) && url.startsWith("content:");
260 * @return True iff the url is valid.
262 public static boolean isValidUrl(String url) {
263 if (url == null || url.length() == 0) {
267 return (isAssetUrl(url) ||
268 isResourceUrl(url) ||
269 isFileUrl(url) ||
270 isAboutUrl(url) ||
271 isHttpUrl(url) ||
272 isHttpsUrl(url) ||
273 isJavaScriptUrl(url) ||
274 isContentUrl(url));
278 * Strips the url of the anchor.
280 public static String stripAnchor(String url) {
281 int anchorIndex = url.indexOf('#');
283 return url.substring(0, anchorIndex);
285 return url;
292 * @param url Url to the content
299 String url,
318 String decodedUrl = Uri.decode(url);