(self, path: PATH_TYPES)
Check whether the provided path is a file.
Check whether the provided path is a file.
Check whether the provided path is a file .
def is_file(self, path: PATH_TYPES) -> bool:
        """Check whether the provided path is a file."""
        if not isinstance(path, SwiftPath):
            path = SwiftPath(path)
        target_path = str(path)
        if target_path == ".":
            return False
        with self.connection() as conn:
            try:
                conn.head_object(self.default_container, target_path)
            except swiftclient.exceptions.ClientException:
                return False
            else:
                return True
def is_file ( self , path : PATH_TYPES ) -> bool : if not isinstance ( path , SwiftPath ) : path = SwiftPath ( path ) target_path = str ( path ) if target_path == "." : return False with self . connection ( ) as conn : try : conn . head_object ( self . default_container , target_path ) except swiftclient . exceptions . ClientException : return False else : return True