Beispiel #1
0
 def exists(self):
     if self._matched_as_path:
         return self._as.exists_in_container(self.container_name, self.blob_name)
     raise AzureFileException(
         "The file cannot be parsed as an Azure Blob path in form 'container/blob': %s"
         % self.local_file()
     )
Beispiel #2
0
 def mtime(self):
     if self.exists():
         t = self._as.blob_last_modified(self.container_name, self.blob_name)
         return t
     else:
         raise AzureFileException(
             "The file does not seem to exist remotely: %s" % self.local_file()
         )
Beispiel #3
0
 def mtime(self):
     if self.exists():
         # b = self.blob_service_client.get_blob_client(self.container_name, self.blob_name)
         # return b.get_blob_properties().last_modified
         t = self._as.blob_last_modified(self.container_name, self.blob_name)
         return t
     raise AzureFileException(
         "The file does not seem to exist remotely: %s" % self.local_file()
     )
Beispiel #4
0
 def as_create_stub(self):
     if self._matched_as_path:
         if not self.exists:
             self._as.download_from_azure_storage(
                 self.container_name,
                 self.blob_name,
                 self.file,
                 create_stub_only=True,
             )
     else:
         raise AzureFileException(
             "The file to be downloaded cannot be parsed as an Azure Storage path in form 'container/blob': %s"
             % self.local_file())