private function createResource($filesystemPath) { return is_dir($filesystemPath) ? new DirectoryResource($filesystemPath) : new FileResource($filesystemPath); }