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

Method extractEncodedPrefix

gpcontrib/gpcloud/src/s3url.cpp:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void S3Url::extractEncodedPrefix() {
73 size_t ibegin = find_Nth(this->sourceUrl, 3, "/");
74 size_t iend = find_Nth(this->sourceUrl, 4, "/");
75
76 // s3://s3-region.amazonaws.com/bucket
77 if (ibegin == string::npos || iend == string::npos) {
78 return;
79 }
80
81 // s3://s3-region.amazonaws.com/bucket/
82 if (iend == this->sourceUrl.length() - 1) {
83 return;
84 }
85
86 ibegin = find_Nth(this->sourceUrl, 4, "/");
87 // s3://s3-region.amazonaws.com/bucket/prefix
88 // s3://s3-region.amazonaws.com/bucket/prefix/whatever
89 this->prefix = this->sourceUrl.substr(ibegin + 1, this->sourceUrl.length() - ibegin - 1);
90
91 this->prefix = UriEncode(this->prefix);
92 FindAndReplace(this->prefix, "%2F", "/");
93}
94
95void S3Url::extractBucket() {
96 size_t ibegin = find_Nth(this->sourceUrl, 3, "/");

Callers

nothing calls this directly

Calls 4

find_NthFunction · 0.85
UriEncodeFunction · 0.85
FindAndReplaceFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected