if (!dstPath.exists() || (dstPath.isDirectory() && !SVNWCAccess.isVersionedDirectory(dstPath))) { createVersionedDirectory(dstPath, url, uuid, revNumber); result = doUpdate(dstPath, revision, recursive); } else if (dstPath.isDirectory() && SVNWCAccess.isVersionedDirectory(dstPath)) { SVNWCAccess wcAccess = SVNWCAccess.create(dstPath); if (url.equals(wcAccess.getTargetEntryProperty(SVNProperty.URL))) {
try { if (!dstPath.exists() || (dstPath.isDirectory() && !SVNWCAccess.isVersionedDirectory(dstPath))) { createVersionedDirectory(dstPath, url, uuid, revNumber);
    public long doCheckout(String url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException {        url = validateURL(url);        if (dstPath == null) {            dstPath = new File(".", PathUtil.tail(url));        }        if (!revision.isValid() && !pegRevision.isValid()) {            pegRevision = SVNRevision.HEAD;            revision = SVNRevision.HEAD;        } else if (!revision.isValid()) {            revision = pegRevision;        } else if (!pegRevision.isValid()) {            pegRevision = revision;        }        url = getURL(url, pegRevision, revision);        SVNRepository repos = createRepository(url);        long revNumber = getRevisionNumber(url, revision);        SVNNodeKind targetNodeKind = repos.checkPath("", revNumber);        String uuid = repos.getRepositoryUUID();        if (targetNodeKind == SVNNodeKind.FILE) {            SVNErrorManager.error(0, null);        } else if (targetNodeKind == SVNNodeKind.NONE) {            SVNErrorManager.error(0, null);        }        long result = -1;        if (!dstPath.exists() || (dstPath.isDirectory() && !SVNWCAccess.isVersionedDirectory(dstPath))) {            createVersionedDirectory(dstPath, url, uuid, revNumber);            result = doUpdate(dstPath, revision, recursive);        } else if (dstPath.isDirectory() && SVNWCAccess.isVersionedDirectory(dstPath)) {            SVNWCAccess wcAccess = SVNWCAccess.create(dstPath);            if (url.equals(wcAccess.getTargetEntryProperty(SVNProperty.URL))) {                result = doUpdate(dstPath, revision, recursive);            } else {                SVNErrorManager.error(0, null);            }        } else {            SVNErrorManager.error(0, null);        }        return result;    }