the following are examples of absolute urls : http://host:80/path ftp://user:pw@host:port/path news : a.news.group file : / c : / config.sys mailto:alasdair@domain.tld this method does not provide a comprehensive test for all url cases , but should suffice for most . concode_field_sep int URL_CONTEXTPATH concode_elem_sep int URL_PATHINFO concode_elem_sep int URL_SERVLETPATH concode_elem_sep int URL_QUERYSTRING concode_elem_sep int URL_SERVER concode_field_sep String getRequestUrl concode_elem_sep String getRequestUrl concode_elem_sep String getRequestUrl concode_elem_sep Map<String,String> getParamsMap concode_elem_sep String getBaseUrl concode_elem_sep StringBuilder appendServerUrl concode_elem_sep String getContextUrl concode_elem_sep String makeUrlAbsolute concode_elem_sep StringBuilder appendBaseUrl concode_elem_sep String getServerUrl
boolean function ( String arg0 ) { int loc0 = arg0 . indexOf ( ':' ) ; if ( loc0 < 0 ) { return false ; } for ( int loc1 = 0 ; loc1 < loc0 ; loc1 ++ ) { char loc2 = arg0 . charAt ( loc1 ) ; if ( Character . isLetterOrDigit ( loc2 ) ) { continue ; } else { return false ; } } return true ; }