def _GetDirectory(self):
    """Retrieves a directory.

    Returns:
      TARDirectory: a directory or None if not available.
    """
    if self.entry_type != definitions.FILE_ENTRY_TYPE_DIRECTORY:
      return None
    return TARDirectory(self._file_system, self.path_spec)
Retrieves a directory.

    Returns:
      TARDirectory: a directory or None if not available.