if(adv.indexOf("/") != -1) host = adv.substring(0, adv.indexOf("/"));
String path = ""; if(adv.indexOf("/") != -1) { host = adv.substring(0, adv.indexOf("/")); path = adv.substring(adv.indexOf("/")); }
    protected void createStringURL() throws SmartFrogException, RemoteException {        Context c = sfContext();        Object value = c.get("toAdvertise");        if(value instanceof Reference) {            // check if we are advertising the process compound.            Reference r = (Reference)value;            if(r.toString().endsWith("sfProcess")) {                // advertising process compound. Need to get hostname.                r.setElementAt(new HereReferencePart("sfHost"), r.size()-1);                InetAddress host = (InetAddress)sfResolve(r);                serviceURL = new ServiceURL(serviceType+"://"+host.getCanonicalHostName()+"/"+toAdvertise.toString(),                                            serviceLifetime);                return;            }        }        // Check if string could be a URL.        String adv = toAdvertise.toString();        String host = adv;        if(adv.indexOf("/") != -1) host = adv.substring(0, adv.indexOf("/"));        boolean url = false;        try {            InetAddress a = InetAddress.getByName(host);            serviceURL = new ServiceURL(serviceType+"://"+a, serviceLifetime);            url = true;        }catch(Exception ex) { }                if(!url) {            // not a url. Just add String to URLPath.            serviceURL = new ServiceURL(serviceType+":///"+toAdvertise.toString(), serviceLifetime);        }    }