/**
  * Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list
  * of {@link ResourceRoot}s in the {@link DeploymentUnit deploymentUnit}
  *
  * @param file The file for which the resource root will be created
  * @return Returns the created {@link ResourceRoot}
  * @throws java.io.IOException
  */
 private synchronized ResourceRoot createResourceRoot(final VirtualFile file)
     throws DeploymentUnitProcessingException {
   try {
     final Closeable closable =
         file.isFile() ? VFS.mountZip(file, file, TempFileProviderService.provider()) : null;
     final MountHandle mountHandle = new MountHandle(closable);
     final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle);
     ModuleRootMarker.mark(resourceRoot);
     ResourceRootIndexer.indexResourceRoot(resourceRoot);
     return resourceRoot;
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }