protected void add(String file, int fileType) 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(); Entry entry = (Entry) table.get(file); if (entry == null) { entry = new Entry(0, 1, fileType); table.put(file, entry);    int oldestGeneration = findOldestGeneration(file); if (oldestGeneration != 0) entry.setWriteId(oldestGeneration + 1); save(); } else { if (entry.getFileType() != fileType) { entry.setFileType(fileType); updateTable(); save(); } } } finally { release(); }
public void add(String file) throws IOException { add(file, FILETYPE_STANDARD);
	protected void add(String file, int fileType) 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();			Entry entry = (Entry) table.get(file);			if (entry == null) {				entry = new Entry(0, 1, fileType);				table.put(file, entry);				// if this file existed before, ensure there is not an old				//  version on the disk to avoid name collisions. If version found,				//  us the oldest generation+1 for the write ID.				int oldestGeneration = findOldestGeneration(file);				if (oldestGeneration != 0)					entry.setWriteId(oldestGeneration + 1);				save();			} else {				if (entry.getFileType() != fileType) {					entry.setFileType(fileType);					updateTable();					save();				}			}		} finally {			release();		}	}