Here you can find the source of getKey(URI uri)
public static String getKey(URI uri)
//package com.java2s; import java.net.URI; public class Main { /**/*w ww. j a v a 2s .c om*/ * @return scheme+host+port. */ public static String getKey(URI uri) { String s = uri.getScheme(); String h = uri.getHost(); int p = uri.getPort(); if (s == null) s = "file"; if (h == null) h = ""; if (p == -1) return s + h; return s + h + p; } }