Utility java.net functions to make life simpler