bool S3Init::file_exists()

in awsio/csrc/io/s3/s3_io.cpp [353:364]


bool S3Init::file_exists(const std::string &file_url) {
    std::string bucket, object;
    parseS3Path(file_url, &bucket, &object);
    Aws::S3::Model::HeadObjectRequest headObjectRequest;
    headObjectRequest.WithBucket(bucket.c_str()).WithKey(object.c_str());
    auto headObjectOutcome =
        this->initializeS3Client()->HeadObject(headObjectRequest);
    if (headObjectOutcome.IsSuccess()) {
        return true;
    }
    return false;
}