input: Write a function to simulate a file system that manages task data stored in directories. The function should allow saving, deleting, finding, and listing tasks. Specifically, the function should implement the following methods:
  
  1. `save_task(data)`: Saves a task with given data. If the data does not include an 'id', generate one. The task data will be stored in a file in a subdirectory named after the task ID.
  2. `delete_task(task_id)`: Deletes the task with the given ID by removing the corresponding subdirectory.
  3. `find_by_id(task_id)`: Finds and returns the task data for the given ID as a dictionary.
  4. `find_by_ids(task_ids)`: Finds and returns a list of task data dictionaries for the given list of IDs.
  5. `all_task_data(order='asc')`: Returns a list of all task data dictionaries, sorted by ID in ascending order by default, or descending if 'order' is set to 'desc'.
  6. `task_data(task_id)`: Returns the task data for the given ID as a dictionary, or None if the data is not found.
  
  The class should be initialized with a parameter dictionary containing a 'taskDir' key specifying the directory where task data is stored.
  
  assert save_task({'name': 'Task1', 'details': 'First task'})['name']=='Task1'
  assert delete_task(1)==None
  assert find_by_id(1)['name']=='Task1'
  assert find_by_ids([1, 2])[0]['name']=='Task1'
  assert all_task_data(order='desc')[0]['name']=='Task2'
  assert task_data(3)==None
output: 
  import os
  import json
  import uuid
  
  class TaskManager:
      def __init__(self, params):
          self.taskDir = params['taskDir']
          os.makedirs(self.taskDir, exist_ok=True)
  
      def save_task(self, data):
          if 'id' not in data:
              data['id'] = str(uuid.uuid4())
          task_id = data['id']
          task_dir = os.path.join(self.taskDir, task_id)
          os.makedirs(task_dir, exist_ok=True)
          with open(os.path.join(task_dir, 'data.json'), 'w') as f:
              json.dump(data, f)
          return data
  
      def delete_task(self, task_id):
          task_dir = os.path.join(self.taskDir, str(task_id))
          if os.path.exists(task_dir):
              for file in os.listdir(task_dir):
                  os.remove(os.path.join(task_dir, file))
              os.rmdir(task_dir)
  
      def find_by_id(self, task_id):
          task_dir = os.path.join(self.taskDir, str(task_id))
          data_file = os.path.join(task_dir, 'data.json')
          if os.path.exists(data_file):
              with open(data_file, 'r') as f:
                  return json.load(f)
          return None
  
      def find_by_ids(self, task_ids):
          return [self.find_by_id(task_id) for task_id in task_ids if self.find_by_id(task_id) is not None]
  
      def all_task_data(self, order='asc'):
          all_data = [self.find_by_id(task_id) for task_id in os.listdir(self.taskDir) if self.find_by_id(task_id) is not None]
          all_data.sort(key=lambda x: x['id'], reverse=order=='desc')
          return all_data
  
      def task_data(self, task_id):
          return self.find_by_id(task_id)
  