(self, path: PATH_TYPES)
Check whether the provided path is a directory.
Check whether the provided path is a directory.
Check whether the provided path is a directory .
def is_dir(self, path: PATH_TYPES) -> bool:
        """Check whether the provided path is a directory."""
        if not isinstance(path, SwiftPath):
            path = SwiftPath(str(path))
        target_path = str(path)
        if target_path == ".":
            target_path = ""
        if target_path and not target_path.endswith("/"):
            target_path = f"{target_path}/"
        files: List[str] = []
        with self.connection() as conn:
            try:
                files = conn.get_container(self.default_container, prefix=target_path)
            except swiftclient.exceptions.ClientException:
                return False
            return bool(files)
def is_dir ( self , path : PATH_TYPES ) -> bool : if not isinstance ( path , SwiftPath ) : path = SwiftPath ( str ( path ) ) target_path = str ( path ) if target_path == "." : target_path = "" if target_path and not target_path . endswith ( "/" ) : target_path = f"{target_path}/" files : List [ str ] = [ ] with self . connection ( ) as conn : try : files = conn . get_container ( self . default_container , prefix = target_path ) except swiftclient . exceptions . ClientException : return False return bool ( files )