String hash = Integer.toString(canonicalName.toString().hashCode(),36); canonicalName.append("_"); canonicalName.append(hash);
    private String getCanonicalNameForWebAppTmpDir ()    {        StringBuffer canonicalName = new StringBuffer();        canonicalName.append("Jetty");               //get the host and the port from the first connector         Connector[] connectors = getServer().getConnectors();                        //Get the host        canonicalName.append("_");        String host = (connectors==null||connectors[0]==null?"":connectors[0].getHost());        if (host == null)            host = "0.0.0.0";        canonicalName.append(host.replace('.', '_'));                //Get the port        canonicalName.append("_");        //try getting the real port being listened on        int port = (connectors==null||connectors[0]==null?0:connectors[0].getLocalPort());        //if not available (eg no connectors or connector not started),         //try getting one that was configured.        if (port < 0)            port = connectors[0].getPort();        canonicalName.append(port);               //Context name        canonicalName.append("_");        String contextPath = getContextPath();        contextPath=contextPath.replace('/','_');        contextPath=contextPath.replace('.','_');        contextPath=contextPath.replace('\\','_');        canonicalName.append(contextPath);                //Virtual host (if there is one)        canonicalName.append("_");        String[] vhosts = getVirtualHosts();        canonicalName.append((vhosts==null||vhosts[0]==null?"":vhosts[0]));                return canonicalName.toString();    }