root = SVNEncodingUtil.uriEncode(root);
    public void open(DAVRepository repository) throws SVNException {        if (myHttpConnection == null) {        	myHttpConnection = new HttpConnection(myLocation, repository);            if (repository.getRepositoryUUID() == null) {                String path = myLocation.getPath();                path = SVNEncodingUtil.uriEncode(path);                final DAVResponse[] result = new DAVResponse[1];                StringBuffer body = DAVPropertiesHandler.generatePropertiesRequest(null, DAVElement.STARTING_PROPERTIES);                IDAVResponseHandler handler = new IDAVResponseHandler() {                    public void handleDAVResponse(DAVResponse response) {                        result[0] = response;                    }                };                while(true) {                    DAVStatus status = myHttpConnection.request("PROPFIND", path, 0, null, body, new DAVPropertiesHandler(handler), new int[] {200, 207, 404});                    if (status.getResponseCode() == 404) {                        if ("".equals(path) || "/".equals(path)) {                            throw new SVNException(status.getErrorText());                        }                        path = SVNPathUtil.removeTail(path);                    } else if (status.getResponseCode() == 200 || status.getResponseCode() == 207) {                        break;                    } else {                        throw new SVNException(status.getErrorText());                    }                }                String uuid = (String) result[0].getPropertyValue(DAVElement.REPOSITORY_UUID);                String relativePath = (String) result[0].getPropertyValue(DAVElement.BASELINE_RELATIVE_PATH);                                String root = myLocation.getPath();                root = SVNEncodingUtil.uriEncode(root);                if (relativePath != null) {                    if (root.endsWith(relativePath)) {                        root = root.substring(0, root.length() - relativePath.length() - 1);                                            }                } else {                	root = path;                }                // do not use port if location had no port specified                String url;                if (myLocation.toString().lastIndexOf(':') != myLocation.toString().indexOf("://")) {                    url = myLocation.getProtocol() + "://" + myLocation.getHost() + ":" + myLocation.getPort() + root;                } else {                    url = myLocation.getProtocol() + "://" + myLocation.getHost() + root;                }                repository.updateCredentials(uuid, url);            }        }    }    