Check if an argument looks like an S3 bucket

check_s3_uri(x)

Arguments

x

string, URI of an S3 object, should start with s3://, then bucket name and object key

Examples

check_s3_uri('s3://foo/bar')
#> [1] TRUE
check_s3_uri('https://foo/bar')
#> [1] "Does not seem to be an S3 URI as per regular expression: '^s3://[a-z0-9][a-z0-9\\.-]+[a-z0-9](/(.*)?)?$'"
if (FALSE) { assert_s3_uri('https://foo/bar') }