def directoryclient_create(self, path, test_hns_enabled=False):
     '''
     Return azure.storage.filedatalake.DataLakeDirectoryClient for the given path
     '''
     if not isinstance(self._name, ContainerName):
         raise ApplicationException("may not %s for %r" %
                                    (self.mth(), self._name))
     directory_client = None
     dsc = self._datalakeserviceclient_get()
     if dsc:
         directory_client = msapicall(self.logger, dsc.get_directory_client,
                                      self._name.container_name, path)
     if not directory_client:
         return None
     if test_hns_enabled and (not self._test_hns_enabled(directory_client)):
         return None
     return directory_client
 def _generate_filesystemclient(self, credential=None):
     '''
     Generate and return azure.storage.filedatalake.FileSystemClient.
     '''
     if not isinstance(self._name, ContainerName):
         raise ApplicationException("may not %s for %r" %
                                    (self.mth(), self._name))
     credential = credential or self.sb_credential_preferred
     ret = None
     with self._lock:
         dsc = self._datalakeserviceclient_get()
         if dsc:
             ret = msapicall(self.logger,
                             dsc.get_file_system_client,
                             self._name.container_name,
                             credential=credential)
         if (not ret) and self.warn_missing:
             self.logger.warning(
                 "%s cannot generate FileSystemClient for %r", self.mth(),
                 self._name)
         return ret
 def _generate_blobclient(self, blob_name: str):
     '''
     Generate and remember blobclient.
     '''
     ret = None
     with self._lock:
         assert isinstance(self._name, ContainerName)
         cc = self._containerclient_get()
         if cc:
             blob_name = urllib.parse.quote(blob_name)
             try:
                 ret = msapicall(self.logger, cc.get_blob_client, blob_name)
             except Exception as exc:
                 caught = laaso.az.azure.msapicall.Caught(exc)
                 if not caught.is_missing():
                     raise
         if (not ret) and self.warn_missing:
             self.logger.warning(
                 f"{self.mth()}: cannot generate BlobClient for blob_name={blob_name!r} name={self.name!r}"
             )
         return ret
 def _generate_queueclient(self):
     '''
     Generate and return queueclient.
     '''
     ret = None
     if not isinstance(self._name, QueueName):
         raise ApplicationException("may not %s for %r" %
                                    (self.mth(), self._name))
     with self._lock:
         qsc = self._queueserviceclient_get()
         if qsc:
             try:
                 ret = msapicall(self.logger, qsc.get_queue_client,
                                 self._name.queue_name)
             except Exception as exc:
                 caught = laaso.az.azure.msapicall.Caught(exc)
                 if not caught.is_missing():
                     raise
         if (not ret) and self.warn_missing:
             self.logger.warning("%s: cannot generate QueueClient for %r",
                                 self.mth(), self._name)
         return ret
 def _generate_containerclient(self):
     '''
     Generate and return containerclient.
     '''
     ret = None
     with self._lock:
         if not isinstance(self._name, ContainerName):
             raise ApplicationException("may not %s for %r" %
                                        (self.mth(), self._name))
         bsc = self._blobserviceclient_get()
         if bsc:
             try:
                 ret = msapicall(self.logger, bsc.get_container_client,
                                 self._name.container_name)
             except Exception as exc:
                 caught = laaso.az.azure.msapicall.Caught(exc)
                 if not caught.is_missing():
                     raise
         if (not ret) and self.warn_missing:
             self.logger.warning(
                 "%s: cannot generate ContainerClient for %r", self.mth(),
                 self._name)
         return ret