protected boolean validateContainer() { IPath path = containerGroup.getContainerFullPath(); if (path == null) { problemType = PROBLEM_CONTAINER_EMPTY; problemMessage = Messages.getString("WizardSaveAsPage.FolderEmpty"); return false; } IWorkspace workspace = ResourcesPlugin.getWorkspace(); String projectName = path.segment(0); if (projectName == null || !workspace.getRoot().getProject(projectName).exists()) { problemType = PROBLEM_PROJECT_DOES_NOT_EXIST; problemMessage = Messages.getString("WizardSaveAsPage.NoProject"); return false; }  IWorkspaceRoot root = workspace.getRoot(); while (path.segmentCount() > 1) { if (root.getFile(path).exists()) { problemType = PROBLEM_PATH_OCCUPIED; problemMessage = NLS.bind(Messages.getString("WizardSaveAsPage.PathOccupied"), path.makeRelative()); return false; } path = path.removeLastSegments(1); } return true; }
protected boolean validateContainer( ) { IPath path = containerGroup.getContainerFullPath( ); if ( path == null ) { problemType = PROBLEM_CONTAINER_EMPTY; problemMessage = Messages .getString( "WizardSaveAsPage.FolderEmpty" ); return false; } IWorkspace workspace = ResourcesPlugin.getWorkspace( ); String projectName = path.segment( 0 ); if ( projectName == null || !workspace.getRoot( ).getProject( projectName ).exists( ) ) { problemType = PROBLEM_PROJECT_DOES_NOT_EXIST; problemMessage = Messages.getString( "WizardSaveAsPage.NoProject" ); return false; }  IWorkspaceRoot root = workspace.getRoot( ); while ( path.segmentCount( ) > 1 ) { if ( root.getFile( path ).exists( ) ) { problemType = PROBLEM_PATH_OCCUPIED; problemMessage = Messages .getFormattedString( "WizardSaveAsPage.PathOccupied", new Object[]{path.makeRelative( )} ); return false; } path = path.removeLastSegments( 1 ); } return true; }
    protected boolean validateContainer() {        IPath path = containerGroup.getContainerFullPath();        if (path == null) {            problemType = PROBLEM_CONTAINER_EMPTY;            problemMessage = Messages.getString("WizardSaveAsPage.FolderEmpty"); //$NON-NLS-1$            return false;        }        IWorkspace workspace = ResourcesPlugin.getWorkspace();        String projectName = path.segment(0);        if (projectName == null                || !workspace.getRoot().getProject(projectName).exists()) {            problemType = PROBLEM_PROJECT_DOES_NOT_EXIST;            problemMessage = Messages.getString("WizardSaveAsPage.NoProject"); //$NON-NLS-1$            return false;        }        //path is invalid if any prefix is occupied by a file        IWorkspaceRoot root = workspace.getRoot();        while (path.segmentCount() > 1) {        	if (root.getFile(path).exists()) {        		problemType = PROBLEM_PATH_OCCUPIED;        		problemMessage = NLS.bind(Messages.getString("WizardSaveAsPage.PathOccupied"), path.makeRelative()); //$NON-NLS-1$        		return false;        	}        	path = path.removeLastSegments(1);        }        return true;    }