+ throw new IOException("HTTP only supports http/https urls");
+ }
+ if (url.indexOf("://") == -1) throw new IOException("URLs must contain a ://");
+ String temphost = url.substring(url.indexOf("://") + 1);
+ path = temphost.substring(temphost.indexOf('/'));
+ temphost = temphost.substring(0, temphost.indexOf('/'));
+ if (temphost.indexOf(':') != -1) {
+ port = Integer.parseInt(temphost.substring(temphost.indexOf(':')+1));
+ temphost = temphost.substring(0, temphost.indexOf(':'));