DAVResource newDir = new DAVResource(myCommitMediator, myConnection, PathUtil.encode(path), -1, copyPath != null);
DAVResource newDir = new DAVResource(myCommitMediator, myConnection, path, -1, copyPath != null);
    public void addDir(String path, String copyPath, long copyRevision) throws SVNException {        path = PathUtil.encode(path);        DAVResource parentResource = (DAVResource) myDirsStack.peek();        if (parentResource.getWorkingURL() == null) {        	String filePath = PathUtil.append(parentResource.getURL(), PathUtil.tail(path));    		DAVResponse responce = DAVUtil.getResourceProperties(myConnection, filePath, null, DAVElement.STARTING_PROPERTIES, true);    		if (responce != null) {    			throw new SVNException("Directory '"  + filePath + "' already exists");    		}        }        checkoutResource(parentResource);        String wPath = parentResource.getWorkingURL();        DAVResource newDir = new DAVResource(myCommitMediator, myConnection, PathUtil.encode(path), -1, copyPath != null);        newDir.setWorkingURL(PathUtil.append(wPath, PathUtil.tail(path)));        myDirsStack.push(newDir);        myPathsMap.put(newDir.getURL(), path);        if (copyPath != null) {            // convert to full path?	        copyPath = PathUtil.encode(copyPath);            copyPath = myRepository.getFullPath(copyPath);            DAVBaselineInfo info = DAVUtil.getBaselineInfo(myConnection, copyPath, copyRevision, false, false, null);            copyPath = PathUtil.append(info.baselineBase, info.baselinePath);            // full url.            wPath = myLocation.getProtocol() + "://" + myLocation.getHost() + ":" + myLocation.getPort() +            	PathUtil.encode(newDir.getWorkingURL());            DAVStatus status = myConnection.doCopy(copyPath, wPath);            if (status.getResponseCode() != 201 && status.getResponseCode() != 204) {                throw new SVNException("COPY failed: " + status);            }        } else {            DAVStatus status = myConnection.doMakeCollection(newDir.getWorkingURL());            if (status.getResponseCode() != 201) {                throw new SVNException("MKCOL failed: " + status);            }        }    }