ISVNRemoteResource dotProject = folders[i].getRepository().getRemoteFile("/" + name + "/.project"); InputStream is = dotProject.getContents(monitor); DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); org.w3c.dom.Document doc = db.parse(is); is.close(); NodeList nl = doc.getDocumentElement().getChildNodes(); for (int j = 0; j < nl.getLength(); ++j) { Node child = nl.item(j); if (child instanceof Element && "name".equals(child.getNodeName())) { Node grandChild = child.getFirstChild(); if (grandChild instanceof Text) name = ((Text)grandChild).getData();
ISVNResource[] children = folders[i].members(monitor, ISVNFolder.FILE_MEMBERS); for (int k = 0; k < children.length; k++) { ISVNResource resource = children[k]; if(".project".equals(resource.getName())){ ISVNRemoteFile dotProject = folders[0].getRepository().getRemoteFile(new SVNUrl(Util.appendPath(folders[i].getUrl().get(), ".project")));  InputStream is = dotProject.getContents(monitor); DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); org.w3c.dom.Document doc = db.parse(is); is.close(); NodeList nl = doc.getDocumentElement().getChildNodes(); for (int j = 0; j < nl.getLength(); ++j) { Node child = nl.item(j); if (child instanceof Element && "name".equals(child.getNodeName())) { Node grandChild = child.getFirstChild(); if (grandChild instanceof Text) name = ((Text)grandChild).getData(); } }
	protected void checkoutSelectionIntoWorkspaceDirectory() throws InvocationTargetException, InterruptedException {		run(new WorkspaceModifyOperation() {			public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {				try {					ISVNRemoteFolder[] folders = getSelectedRemoteFolders();												List targetProjects = new ArrayList();					Map targetFolders = new HashMap();					monitor.beginTask(null, 100);					for (int i = 0; i < folders.length; i++) {						String name = folders[i].getName();												// Check for a better name for the project						try {							ISVNRemoteResource dotProject = folders[i].getRepository().getRemoteFile("/" + name + "/.project");														InputStream is = dotProject.getContents(monitor);							DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();							org.w3c.dom.Document doc = db.parse(is);							is.close();							NodeList nl = doc.getDocumentElement().getChildNodes();							for (int j = 0; j < nl.getLength(); ++j) {								Node child = nl.item(j);								if (child instanceof Element && "name".equals(child.getNodeName())) {									Node grandChild = child.getFirstChild();									if (grandChild instanceof Text) name = ((Text)grandChild).getData(); 									}							}						}							catch (Exception e) {						  // no .project exists ... that's ok						}						IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);						targetFolders.put(name, folders[i]);						targetProjects.add(project);					}										IResource[] projects = (IResource[]) targetProjects.toArray(new IResource[targetProjects.size()]);										PromptingDialog prompt = new PromptingDialog(getShell(), projects, 																  getOverwriteLocalAndFileSystemPrompt(), 																  Policy.bind("ReplaceWithAction.confirmOverwrite"));//$NON-NLS-1$					projects = prompt.promptForMultiple();																				if (projects.length != 0) {						IProject[] localFolders = new IProject[projects.length];						ISVNRemoteFolder[] remoteFolders = new ISVNRemoteFolder[projects.length];						for (int i = 0; i < projects.length; i++) {							localFolders[i] = (IProject)projects[i];							remoteFolders[i] = (ISVNRemoteFolder)targetFolders.get(projects[i].getName());						}												monitor.setTaskName(getTaskName(remoteFolders));												SVNWorkspaceRoot.checkout(remoteFolders, localFolders, Policy.subMonitorFor(monitor, 100));					}				} catch (TeamException e) {					throw new InvocationTargetException(e);				} finally {					monitor.done();				}			}		}, true /* cancelable */, PROGRESS_DIALOG);	}