private boolean update(String managedFile, String source) throws IOException { Entry entry = (Entry) table.get(managedFile); if (entry == null) add(managedFile); int newId = entry.getWriteId();  boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId); if (!success) {   newId = findOldestGeneration(managedFile) + 1; success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId);
public void update(String[] managedFiles, String[] sources) throws IOException { if (!open) throw new IOException(EclipseAdaptorMsg.fileManager_notOpen); if (readOnly) throw new IOException(EclipseAdaptorMsg.fileManager_illegalInReadOnlyMode); if (!lock(true)) throw new IOException(EclipseAdaptorMsg.fileManager_cannotLock); try { updateTable(); int[] originalReadIDs = new int[managedFiles.length]; boolean error = false; for (int i = 0; i < managedFiles.length; i++) { originalReadIDs[i] = getId(managedFiles[i]); if (!update(managedFiles[i], sources[i])) error = true; } if (error) {  for (int i = 0; i < managedFiles.length; i++) { Entry entry = (Entry) table.get(managedFiles[i]); entry.setReadId(originalReadIDs[i]); } throw new IOException(EclipseAdaptorMsg.fileManager_updateFailed); } save(); } finally { release();
	private boolean update(String managedFile, String source) throws IOException {		Entry entry = (Entry) table.get(managedFile);		if (entry == null)			add(managedFile);		int newId = entry.getWriteId();		// attempt to rename the file to the next generation		boolean success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId);		if (!success) {			//possible the next write generation file exists? Lets determine the largest			//generation number, then use that + 1.			newId = findOldestGeneration(managedFile) + 1;			success = move(getAbsolutePath(source), getAbsolutePath(managedFile) + '.' + newId);		}		if (!success)			return false;		// update the entry. read and write ids should be the same since		// everything is in sync		entry.setReadId(newId);		entry.setWriteId(newId + 1);		return true;	}