import java.net.URI;
import java.net.URISyntaxException;

class Ideone {

    public static void main(String[] args) {
        String problemUrl = "http:///1.1.1.1:8001"; 

        try {
            URI uriProblem = new URI(problemUrl); 
            System.out.println("Three slash");
            System.out.println("Host is: " + uriProblem.getHost());
            System.out.println("Path is: " + uriProblem.getPath());

        } catch (URISyntaxException e) {
            System.out.println("Caught Exception: " + e.getMessage());
            System.out.println("Result: Fails validation.");
        }
        
        System.out.println("\n----------------------------------\n");

        String correctUrl = "http://1.1.1.1:8001"; 

        try {
            URI uriCorrect = new URI(correctUrl);
            
            System.out.println("Two slash");
            System.out.println("Host is: " + uriCorrect.getHost());
            System.out.println("Path is: " + uriCorrect.getPath());

        } catch (URISyntaxException e) {
            System.out.println("Exception: " + e.getMessage());
        }
    }
}