Returns true if our current URL is absolute, false otherwise. taken from org.apache.taglibs.standard.tag.common.core.ImportSupport @param url The URL @return true if the URL is absolute
(String url)
| 99 | * @return <code>true</code> if the URL is absolute |
| 100 | */ |
| 101 | public static boolean isAbsoluteUrl(String url) { |
| 102 | if (url == null) { |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | int colonPos = url.indexOf(':'); |
| 107 | if (colonPos == -1) { |
| 108 | return false; |
| 109 | } |
| 110 | |
| 111 | for (int i = 0; i < colonPos; i++) { |
| 112 | if (VALID_SCHEME_CHAR.indexOf(url.charAt(i)) == -1) { |
| 113 | return false; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * Get the value associated with a content-type attribute. Syntax defined in RFC 2045, section 5.1. taken from |
no test coverage detected