* @param file the file
*/
static void cleanup(VirtualFile file)
{
VirtualFileHandler fileHandler = file.getHandler();
VFSContext context = fileHandler.getVFSContext();
try
{
context.cleanupTempInfo(fileHandler.getPathName());
}
catch (Exception e)
{
log.debug("Exception cleaning temp info, file=" + file, e);
}
try
{
VirtualFileHandler contextHandler = context.getRoot();
// the file is the context root, hence possible registry candidate
if (fileHandler.equals(contextHandler))
{
VFSRegistry registry = VFSRegistry.getInstance();
registry.removeContext(context);
TempStore store = context.getTempStore();
if (store != null)
{
store.clear();
}
}