public synchronized Index recreateIndex(IPath containerPath) {
// only called to over write an existing cached index...
String containerPathString = containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
try {
// Path is already canonical
IPath indexLocation = computeIndexLocation(containerPath);
Index index = getIndex(indexLocation);
ReadWriteMonitor monitor = index == null ? null : index.monitor;
if (VERBOSE)
Util.verbose("-> recreating index: "+indexLocation+" for path: "+containerPathString); //$NON-NLS-1$ //$NON-NLS-2$
index = new Index(indexLocation.toOSString(), containerPathString, false /*reuse index file*/);
this.indexes.put(indexLocation, index);
index.monitor = monitor;
return index;
} catch (IOException e) {
// The file could not be created. Possible reason: the project has been deleted.