it = _fileRefs.iterator();
it = _resourceFileRefs.iterator();
	public void save( File projectFile ) {	    ObjectsTable objectsTable = new ObjectsTable();	    String projectPath;	    try {	        projectPath = projectFile.getCanonicalPath();	    } catch (IOException ex) {	        throw new RuntimeException("Can't get path of project file: " + projectFile);	    }	    int last = projectPath.lastIndexOf(File.separator);	    if(last != -1) {	        projectPath = projectPath.substring(0, last);	    }	    last = projectPath.lastIndexOf(File.separator);	    if(last != -1) {	        projectPath = projectPath.substring(0, last);	    }	    	    ArrayList sourceBuildFileIDs = new ArrayList();	    ArrayList resourceBuildFileIDs = new ArrayList();	    ArrayList frameworkBuildFileIDs = new ArrayList();	    	    ArrayList sourceFileIDs = new ArrayList();	    ArrayList resourceFileIDs = new ArrayList();	    ArrayList frameworkFileIDs = new ArrayList();	    	    //	Walk refs, creating the appropriate reference type and an associated	    //  build file for each and adding it to the objects table and group children list.	    String path;	    Iterator it;				it = _sourceRefs.iterator();		while( it.hasNext() ) {		    path = (String) it.next();		    if(path.indexOf(projectPath) == 0) {		        path = path.substring(projectPath.length()+1);		    }		    File file = new File(path);		    Map reference = newFileReference(file.getName(), path);			ObjectsTable.ID refID = objectsTable.insert(reference);			sourceFileIDs.add(refID);			sourceBuildFileIDs.add(objectsTable.insert(newBuildFile(refID)));		}		it = _fileRefs.iterator();		while( it.hasNext() ) {		    path = (String) it.next();		    if(path.indexOf(projectPath) == 0) {		        path = path.substring(projectPath.length()+1);		    }		    File file = new File(path);		    Map reference = newFileReference(file.getName(), path);			ObjectsTable.ID refID = objectsTable.insert(reference);			resourceFileIDs.add(refID);			resourceBuildFileIDs.add(objectsTable.insert(newBuildFile(refID)));		}		it = _folderRefs.iterator();		while( it.hasNext() ) {		    path = (String) it.next();		    if(path.indexOf(projectPath) == 0) {		        path = path.substring(projectPath.length()+1);		    }		    File file = new File(path);		    Map reference = newFolderReference(file.getName(), path);			ObjectsTable.ID refID = objectsTable.insert(reference);			resourceFileIDs.add(refID);			resourceBuildFileIDs.add(objectsTable.insert(newBuildFile(refID)));		}		it = _frameworkRefs.iterator();		while( it.hasNext() ) {			path = (String) it.next();		    Map reference = newFrameworkReference((new File(path)).getName(), path );			ObjectsTable.ID refID = objectsTable.insert(reference);			frameworkFileIDs.add(refID);			frameworkBuildFileIDs.add(objectsTable.insert(newBuildFile(refID)));		}				ArrayList childrenIDs = new ArrayList();	    childrenIDs.add(objectsTable.insert(newGroup( "Sources", sourceFileIDs)));		childrenIDs.add(objectsTable.insert(newGroup( "Resources", resourceFileIDs)));		childrenIDs.add(objectsTable.insert(newGroup( "Frameworks", frameworkFileIDs)));				//	Create the PBXGroup and add it to the objects table.		ObjectsTable.ID mainGroupID = objectsTable.insert( newGroup( "Root", childrenIDs) );				//	Create the PBXBuildPhase and add it to the objects table.		ArrayList buildPhaseIDs = new ArrayList( 1 );		if (hasBuildPhases()) {			buildPhaseIDs.add( objectsTable.insert( newSourcesBuildPhase( sourceBuildFileIDs)));			buildPhaseIDs.add( objectsTable.insert( newResourcesBuildPhase( resourceBuildFileIDs)));			buildPhaseIDs.add( objectsTable.insert( newFrameworkBuildPhase( frameworkBuildFileIDs)));		}				//	Create the PBXToolTarget and add it to the objects table and		//	the targets list.		ArrayList targetIDs = new ArrayList( 1 );		targetIDs.add( objectsTable.insert( newAppServerTarget(buildPhaseIDs, objectsTable)));				//	Create the PBXProject and add it to the objects table.		ObjectsTable.ID projectID = objectsTable.insert( newProject( mainGroupID, targetIDs, objectsTable ));				//	Create the root dictionary.		Map pbxproj = newPBXProj( objectsTable, projectID);				PropertyListSerialization.propertyListToFile( projectFile, pbxproj );	}