class_docstr: Stores artifacts on DBFS using the DBFS REST API.
  
  This repository is used with URIs of the form ``dbfs:/<path>``. The repository can only be used
  together with the RestStore.
class_docstr_tok: ["Stores","artifacts","on","DBFS","using","the","DBFS","REST","API",".","This","repository","is","used","with","URIs","of","the","form","``","dbfs",":","\/","<","path",">","``",".","The","repository","can","only","be","used","together","with","the","RestStore","."]
code: def list_artifacts(self, path=None):
      dbfs_path = (
          self._get_dbfs_path(path) if path else self._get_dbfs_path("")
      )
      dbfs_list_json = {"path": dbfs_path}
      response = self._dbfs_list_api(dbfs_list_json)
      try:
          json_response = json.loads(response.text)
      except ValueError:
          raise MlflowException(
              f"API request to list files under DBFS path {dbfs_path} failed with "
              f"status code {response.status_code}. Response body: {response.text}"
          )
      # /api/2.0/dbfs/list will not have the 'files' key in the response for empty directories.
      infos = []
      artifact_prefix = strip_prefix(self.artifact_uri, "dbfs:")
      if (
          json_response.get("error_code", None)
          == RESOURCE_DOES_NOT_EXIST
      ):
          return []
      dbfs_files = json_response.get("files", [])
      for dbfs_file in dbfs_files:
          stripped_path = strip_prefix(
              dbfs_file["path"], artifact_prefix + "/"
          )
          # If `path` is a file, the DBFS list API returns a single list element with the
          # same name as `path`. The list_artifacts API expects us to return an empty list in this
          # case, so we do so here.
          if stripped_path == path:
              return []
          is_dir = dbfs_file["is_dir"]
          artifact_size = None if is_dir else dbfs_file["file_size"]
          infos.append(FileInfo(stripped_path, is_dir, artifact_size))
      return sorted(infos, key=lambda f: f.path)
  
imports: import json
  import os
  import posixpath
  import mlflow.utils.databricks_utils
  from mlflow.entities import FileInfo
  from mlflow.environment_variables import MLFLOW_ENABLE_DBFS_FUSE_ARTIFACT_REPO
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.store.artifact.artifact_repo import ArtifactRepository
  from mlflow.store.artifact.databricks_artifact_repo import DatabricksArtifactRepository
  from mlflow.store.artifact.local_artifact_repo import LocalArtifactRepository
  from mlflow.store.tracking.rest_store import RestStore
  from mlflow.tracking._tracking_service import utils
  from mlflow.utils.databricks_utils import get_databricks_host_creds
  from mlflow.utils.file_utils import relative_path_to_artifact_path
  from mlflow.utils.rest_utils import RESOURCE_DOES_NOT_EXIST, http_request, http_request_safe
  from mlflow.utils.string_utils import strip_prefix
  from mlflow.utils.uri import get_databricks_profile_uri_from_artifact_uri, is_databricks_acled_artifacts_uri, is_databricks_model_registry_artifacts_uri, is_valid_dbfs_uri, remove_databricks_profile_info_from_artifact_uri
label_desc: Use image node_id 11 for calling the DbfsRestArtifactRepository obj's underlying member method code with example usage: obj.list_artifacts(path) and returns: sorted, list, list