Lines Matching refs:url

62         // bug 762454: strip period off end of url
72 Log.v(LOGTAG, "smartUrlFilter: failed to parse url = " + inUrl);
109 public static byte[] decode(byte[] url) throws IllegalArgumentException {
110 if (url.length == 0) {
115 byte[] tempData = new byte[url.length];
118 for (int i = 0; i < url.length; i++) {
119 byte b = url[i];
121 if (url.length - i > 2) {
122 b = (byte) (parseHex(url[i + 1]) * 16
123 + parseHex(url[i + 2]));
137 * @return True iff the url is correctly URL encoded
139 static boolean verifyURLEncoding(String url) {
140 int count = url.length();
145 int index = url.indexOf('%');
149 parseHex((byte) url.charAt(++index));
150 parseHex((byte) url.charAt(++index));
157 index = url.indexOf('%', index + 1);
171 * @return True iff the url is an asset file.
173 public static boolean isAssetUrl(String url) {
174 return (null != url) && url.startsWith(ASSET_BASE);
178 * @return True iff the url is a resource file.
181 public static boolean isResourceUrl(String url) {
182 return (null != url) && url.startsWith(RESOURCE_BASE);
186 * @return True iff the url is a proxy url to allow cookieless network
187 * requests from a file url.
191 public static boolean isCookielessProxyUrl(String url) {
192 return (null != url) && url.startsWith(PROXY_BASE);
196 * @return True iff the url is a local file.
198 public static boolean isFileUrl(String url) {
199 return (null != url) && (url.startsWith(FILE_BASE) &&
200 !url.startsWith(ASSET_BASE) &&
201 !url.startsWith(PROXY_BASE));
205 * @return True iff the url is an about: url.
207 public static boolean isAboutUrl(String url) {
208 return (null != url) && url.startsWith("about:");
212 * @return True iff the url is a data: url.
214 public static boolean isDataUrl(String url) {
215 return (null != url) && url.startsWith("data:");
219 * @return True iff the url is a javascript: url.
221 public static boolean isJavaScriptUrl(String url) {
222 return (null != url) && url.startsWith("javascript:");
226 * @return True iff the url is an http: url.
228 public static boolean isHttpUrl(String url) {
229 return (null != url) &&
230 (url.length() > 6) &&
231 url.substring(0, 7).equalsIgnoreCase("http://");
235 * @return True iff the url is an https: url.
237 public static boolean isHttpsUrl(String url) {
238 return (null != url) &&
239 (url.length() > 7) &&
240 url.substring(0, 8).equalsIgnoreCase("https://");
244 * @return True iff the url is a network url.
246 public static boolean isNetworkUrl(String url) {
247 if (url == null || url.length() == 0) {
250 return isHttpUrl(url) || isHttpsUrl(url);
254 * @return True iff the url is a content: url.
256 public static boolean isContentUrl(String url) {
257 return (null != url) && url.startsWith(CONTENT_BASE);
261 * @return True iff the url is valid.
263 public static boolean isValidUrl(String url) {
264 if (url == null || url.length() == 0) {
268 return (isAssetUrl(url) ||
269 isResourceUrl(url) ||
270 isFileUrl(url) ||
271 isAboutUrl(url) ||
272 isHttpUrl(url) ||
273 isHttpsUrl(url) ||
274 isJavaScriptUrl(url) ||
275 isContentUrl(url));
279 * Strips the url of the anchor.
281 public static String stripAnchor(String url) {
282 int anchorIndex = url.indexOf('#');
284 return url.substring(0, anchorIndex);
286 return url;
293 * @param url Url to the content
300 String url,
319 String decodedUrl = Uri.decode(url);