File file = new File(filePath); if (file.exists() && !file.isDirectory()) { file = file.getAbsoluteFile().getParentFile(); if (file == null) { return null; } } filePath = file.getAbsolutePath(); ISVNWorkspace ws = SVNWorkspaceManager.createWorkspace("file", filePath); if (ws != null) { return ws.getRootWorkspace(true, false); } return null;
return createWorkspace(filePath, true);
    public static ISVNWorkspace createWorkspace(String filePath) throws SVNException {        File file = new File(filePath);        if (file.exists() && !file.isDirectory()) {            file = file.getAbsoluteFile().getParentFile();            if (file == null) {                 return null;            }        }        filePath = file.getAbsolutePath();        ISVNWorkspace ws = SVNWorkspaceManager.createWorkspace("file", filePath);        if (ws != null) {            return ws.getRootWorkspace(true, false);        }        return null;    }