public SVNDirectory addDirectory(String path, File file, boolean recursive, boolean lock) throws SVNException { if (myDirectories != null) { SVNDirectory dir = new SVNDirectory(this, path, file); if (myDirectories.put(path, dir) == null && lock && !dir.isLocked()) { dir.lock(); } if (recursive) { File[] dirs = file.listFiles(); for (int i = 0; i < dirs.length; i++) { File childDir = dirs[i]; if (".svn".equals(childDir)) { continue; } SVNFileType fType = SVNFileType.getType(childDir); if (fType == SVNFileType.DIRECTORY && SVNWCAccess.isVersionedDirectory(childDir)) {  String childPath = SVNPathUtil.append(path, childDir .getName()); addDirectory(childPath, childDir, recursive, lock); } } } return dir; } return null;
public SVNDirectory addDirectory(String path, File file) throws SVNException { return addDirectory(path, file, false, false);
    public SVNDirectory addDirectory(String path, File file, boolean recursive,            boolean lock) throws SVNException {        if (myDirectories != null) {            SVNDirectory dir = new SVNDirectory(this, path, file);            if (myDirectories.put(path, dir) == null && lock && !dir.isLocked()) {                dir.lock();            }            if (recursive) {                File[] dirs = file.listFiles();                for (int i = 0; i < dirs.length; i++) {                    File childDir = dirs[i];                    if (".svn".equals(childDir)) {                        continue;                    }                    SVNFileType fType = SVNFileType.getType(childDir);                    if (fType == SVNFileType.DIRECTORY                            && SVNWCAccess.isVersionedDirectory(childDir)) {                        // recurse                        String childPath = SVNPathUtil.append(path, childDir                                .getName());                        addDirectory(childPath, childDir, recursive, lock);                    }                }            }            return dir;        }        return null;    }