Bug 157646 [Import/Export] "Import Existing Project" from zip locks file - prevents deletion
Build: M20060629-1905 Even though I cancel the Import Existing Project wizard without completing it, the zip file selected becomes (and remains) locked and cannot be deleted until the workbench is closed. Steps: File > Import > Existing Projects Into Workspace Select a zip file that does not contain any projects Cancel the wizard, but leave the workbench running Attempt to delete the zipfile Result: On Windows XP, this will result in system error stating: "Cannot delete <filename>: It is being used by another person or program." This problem will continue until the workbench is closed.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java
}
	/**
	 * Get the array of valid project records that can be imported 
	 * from the source workspace or archive, selected by the user.
	 * If a project with the same name exists in both the source workspace and the 
	 * current workspace, it will not appear in the list of projects to import and 
	 * thus cannot be selected for import.
	 * 
	 * Method declared public for test suite.
	 * 
	 * @return ProjectRecord[] array of projects that can be imported into the workspace
	 */
	public ProjectRecord[] getValidProjects(){
		List validProjects = new ArrayList();
		for (int i = 0; i < selectedProjects.length; i++){
			if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) {
				validProjects.add(selectedProjects[i]);
			}
		}
		return (ProjectRecord[]) validProjects.toArray(new ProjectRecord[validProjects.size()]);
	}
	
	/**
	 * Determine if the project with the given name is in the current workspace.
	 * 
	 * @param projectName String the project name to check
	 * @return boolean true if the project with the given name is in this workspace
	 */
	private boolean isProjectInWorkspace(String projectName){
		if (projectName == null) {