String path = null;
    private void sendVersionedStatus(SVNDirectory dir, String name) throws SVNException {        File file;        SVNEntry parentEntry;        SVNDirectory parentDir = null;        SVNEntry entry = dir.getEntries().getEntry(name, true);        String path = null;        if (entry.isDirectory() && !"".equals(name)) {            DebugLog.log("fetching parent dir 0");            // we are in the parent dir, with 'short' entry            parentDir = dir;            dir = dir.getChildDirectory(name);            if (dir == null) {                // why no through wc access???                dir = new SVNDirectory(myWCAccess, "".equals(parentDir.getPath()) ? name : PathUtil.append(parentDir.getPath(), name), parentDir.getFile(name, false));            }            SVNEntry fullEntry = dir.getEntries().getEntry("", false);            if (fullEntry != null) {                entry = fullEntry;            }            path = dir.getPath();        } else  if (entry.isDirectory() && "".equals(name)) {            DebugLog.log("fetching parent dir 1");            // we are in the dir itself already, try to get parent dir.            path = dir.getPath();            if (!"".equals(dir.getPath())) {                // there is parent dir                String parentPath = PathUtil.removeTail(dir.getPath());                parentDir = myWCAccess.getDirectory(parentPath);            } else {                // it is a root of wc.                parentDir = null;            }        } else if (entry.isFile()) {            // it is a file, dir and parentDir are the same.            DebugLog.log("fetching parent dir 2");            parentDir = dir;            path = "".equals(dir.getPath()) ? name : PathUtil.append(dir.getPath(), name);        }        SVNEntry entryInParent = entry;        DebugLog.log("lock path: " + path); // we have to use url for lock path, not wc path!!!//        DebugLog.log("found parent dir: " + parentDir.getRoot());        DebugLog.log("our dir: " + dir.getRoot());        DebugLog.log("our entry: " + entry.asMap());        if (dir == parentDir) {            file = dir.getFile(name, false);            entry = dir.getEntries().getEntry(name, true);            parentEntry = dir.getEntries().getEntry("", true);        } else {            file = dir.getRoot();            entry = dir.getEntries().getEntry("", true);            if (entry == null) {                // probably missing dir.                entry = entryInParent;                dir = parentDir;            }            parentEntry = parentDir != null ? parentDir.getEntries().getEntry("", true) : null;        }        if (parentEntry != null) {            DebugLog.log("parent entry: " + parentEntry.asMap());        }        SVNFileType fileType = SVNFileType.getType(file);        DebugLog.log("passing as entry: " + entry.asMap());        if (parentEntry != null) {            DebugLog.log("passing as parent entry: " + parentEntry.asMap());        }        SVNStatus status = createStatus(entry.getURL(), file, dir, parentEntry, entry, false, fileType, Collections.unmodifiableMap(entry.asMap()));        if (status != null) {            myHandler.handleStatus(status);        }    }