Register all known vfs handlers to open a pathspec types.

def Init():
  """Register all known vfs handlers to open a pathspec types."""
  VFS_HANDLERS.clear()
  _VFS_VIRTUALROOTS.clear()
  vfs_virtualroots = config.CONFIG["Client.vfs_virtualroots"]

  VFS_HANDLERS[files.File.supported_pathtype] = files.File
  VFS_HANDLERS[files.TempFile.supported_pathtype] = files.TempFile
  VFS_HANDLERS[sleuthkit.TSKFile.supported_pathtype] = sleuthkit.TSKFile
  if vfs_registry is not None:
    VFS_HANDLERS[vfs_registry.RegistryFile
                 .supported_pathtype] = vfs_registry.RegistryFile

  for vfs_virtualroot in vfs_virtualroots:
    try:
      handler_string, root = vfs_virtualroot.split(":", 1)
    except ValueError:
      raise ValueError(
          "Badly formatted vfs virtual root: %s. Correct format is "
          "os:/path/to/virtual_root" % vfs_virtualroot)

    handler_string = handler_string.upper()
    handler = rdf_paths.PathSpec.PathType.enum_dict.get(handler_string)
    if handler is None:
      raise ValueError(
          "VFSHandler {} could not be registered, because it was not found in"
          " PathSpec.PathType {}".format(handler_string,
                                         rdf_paths.PathSpec.PathType.enum_dict))

    # We need some translation here, TSK needs an OS virtual root base. For
    # every other handler we can just keep the type the same.
    if handler == rdf_paths.PathSpec.PathType.TSK:
      base_type = rdf_paths.PathSpec.PathType.OS
    else:
      base_type = handler
    _VFS_VIRTUALROOTS[handler] = rdf_paths.PathSpec(
        path=root, pathtype=base_type, is_virtualroot=True)