By just looking for "www", many other urls will still be broken (like github.com for example, or "WWW" for that matter).  I suggest looking for url.toLowercase().startsWith("http").  If false, then prepend the URL_PROTOCOL to the url.