MCPcopy Create free account
hub / github.com/apache/cloudberry / extractBucket

Method extractBucket

gpcontrib/gpcloud/src/s3url.cpp:95–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void S3Url::extractBucket() {
96 size_t ibegin = find_Nth(this->sourceUrl, 3, "/");
97 size_t iend = find_Nth(this->sourceUrl, 4, "/");
98 if (ibegin == string::npos) {
99 return;
100 }
101 // s3://s3-region.amazonaws.com/bucket
102 if (iend == string::npos) {
103 this->bucket = this->sourceUrl.substr(ibegin + 1, this->sourceUrl.length() - ibegin - 1);
104 return;
105 }
106
107 this->bucket = this->sourceUrl.substr(ibegin + 1, iend - ibegin - 1);
108}
109
110bool S3Url::extractRegionFromUrl() {
111 size_t ibegin = this->sourceUrl.find("://s3") +

Callers

nothing calls this directly

Calls 2

find_NthFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected