<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _GetDirectory(self):
 """Retrieves the directory. Returns: LVMDirectory: a directory or None if not available. """

    if self.entry_type != definitions.FILE_ENTRY_TYPE_DIRECTORY:
      return None
    return LVMDirectory(self._file_system, self.path_spec)