-
-
Save michaelklishin/71eaeb702a7af4a20c41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static int validateURI(String srvURI) { | |
try { | |
URI vURI = new URI(srvURI); | |
if (!vURI.getPath().equals("")) { | |
throw new IllegalArgumentException(srvURI); | |
} | |
if (vURI.getScheme().equals("tcp")) { | |
return URI_TYPE_TCP; | |
} | |
else if (vURI.getScheme().equals("ssl")) { | |
return URI_TYPE_SSL; | |
} | |
else if (vURI.getScheme().equals("local")) { | |
return URI_TYPE_LOCAL; | |
} | |
else { | |
throw new IllegalArgumentException(srvURI); | |
} | |
} catch (URISyntaxException ex) { | |
throw new IllegalArgumentException(srvURI); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment