def METHOD_NAME(
    self, remote_cmd: str = "", remote_file: Optional[str] = None
) -> int:
    """Get the file size of the remote file."""
    if remote_file is None:
        if self.direction == "put":
            remote_file = self.dest_file
        elif self.direction == "get":
            remote_file = self.source_file
        else:
            raise ValueError("self.direction is set to an invalid value")
    remote_cmd = f'system "ls -l {self.file_system}/{remote_file}"'
    remote_out = self.ssh_ctl_chan._send_command_str(remote_cmd)
    for line in remote_out.splitlines():
        if remote_file in line:
            file_size = line.split()[4]
            break
    if "Error opening" in remote_out or "No such file or directory" in remote_out:
        raise IOError("Unable to find file on remote system")
    else:
        return int(file_size)