def FinalizeTaskStorage(self, task):
    """Finalizes a processed task storage.

    Moves the task storage file from its temporary directory to the processed
    directory.

    Args:
      task (Task): task.

    Raises:
      IOError: if the storage type is not supported or
          if the storage file cannot be renamed.
      OSError: if the storage type is not supported or
          if the storage file cannot be renamed.
    """
    if self._storage_type != definitions.STORAGE_TYPE_SESSION:
      raise IOError('Unsupported storage type.')

    storage_file_path = self._GetTaskStorageFilePath(task)
    processed_storage_file_path = self._GetProcessedStorageFilePath(task)

    try:
      os.rename(storage_file_path, processed_storage_file_path)
    except OSError as exception:
      raise IOError((
          'Unable to rename task storage file: {0:s} with error: '
          '{1!s}').format(storage_file_path, exception))
Finalizes a processed task storage.

    Moves the task storage file from its temporary directory to the processed
    directory.

    Args:
      task (Task): task.

    Raises:
      IOError: if the storage type is not supported or
          if the storage file cannot be renamed.
      OSError: if the storage type is not supported or
          if the storage file cannot be renamed.