#include <ossimAwsStreamFactory.h>
|
std::shared_ptr< Aws::S3::S3Client > | m_client |
|
Definition at line 27 of file ossimAwsStreamFactory.h.
◆ ~AwsStreamFactory()
ossim::AwsStreamFactory::~AwsStreamFactory |
( |
| ) |
|
|
virtual |
◆ AwsStreamFactory() [1/2]
ossim::AwsStreamFactory::AwsStreamFactory |
( |
| ) |
|
|
protected |
◆ AwsStreamFactory() [2/2]
◆ createIOstream()
std::shared_ptr< ossim::iostream > ossim::AwsStreamFactory::createIOstream |
( |
const std::string & |
connectionString, |
|
|
const ossimKeywordlist & |
options, |
|
|
std::ios_base::openmode |
openMode |
|
) |
| const |
|
virtual |
◆ createIstream()
std::shared_ptr< ossim::istream > ossim::AwsStreamFactory::createIstream |
( |
const std::string & |
connectionString, |
|
|
const ossimKeywordlist & |
options, |
|
|
std::ios_base::openmode |
openMode |
|
) |
| const |
|
virtual |
Implements ossim::StreamFactoryBase.
Definition at line 45 of file ossimAwsStreamFactory.cpp.
50 std::shared_ptr<ossim::S3IStream> result = std::make_shared<ossim::S3IStream>();
62 result->open( f.
string(), options, openMode) ;
64 result->open( connectionString, options, openMode );
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
◆ createOstream()
std::shared_ptr< ossim::ostream > ossim::AwsStreamFactory::createOstream |
( |
const std::string & |
connectionString, |
|
|
const ossimKeywordlist & |
options, |
|
|
std::ios_base::openmode |
openMode |
|
) |
| const |
|
virtual |
◆ exists()
bool ossim::AwsStreamFactory::exists |
( |
const std::string & |
connectionString, |
|
|
bool & |
continueFlag |
|
) |
| const |
|
virtual |
Methods to test if connection exists.
- Parameters
-
connectionString | |
continueFlag | Initializes by this, if set to true, indicates factory handles file/url and no more factory checks are necessary. |
- Returns
- true on success, false, if not.
Implements ossim::StreamFactoryBase.
Definition at line 95 of file ossimAwsStreamFactory.cpp.
101 <<
"ossim::AwsStreamFactory::exists() DEBUG: entered.....\n";
108 if ( connectionString.size() )
111 std::size_t pos = connectionString.find(
"://" );
112 if ( pos != std::string::npos )
115 if( (url.getProtocol() ==
"s3") || (url.getProtocol() ==
"S3") )
117 continueFlag =
false;
129 std::string bucket = url.getIp().string();
130 std::string key = url.getPath().string();
131 Aws::S3::Model::HeadObjectRequest headObjectRequest;
132 headObjectRequest.WithBucket( bucket.c_str() )
133 .WithKey( key.c_str() );
134 auto headObject =
m_client->HeadObject(headObjectRequest);
135 if(headObject.IsSuccess())
138 filesize = headObject.GetResult().GetContentLength();
160 <<
"ossim::AwsStreamFactory::exists() DEBUG: leaving.....\n";
std::shared_ptr< Aws::S3::S3Client > m_client
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
◆ getSharedS3Client()
std::shared_ptr<Aws::S3::S3Client> ossim::AwsStreamFactory::getSharedS3Client |
( |
| ) |
const |
|
inline |
◆ initClient()
void ossim::AwsStreamFactory::initClient |
( |
| ) |
const |
|
protected |
Definition at line 180 of file ossimAwsStreamFactory.cpp.
References ossimPreferences::instance().
182 Aws::Client::ClientConfiguration config;
186 preferencesKWL().findKey(std::string(
"ossim.plugins.aws.s3.region"));
189 config.region = region.c_str();
192 m_client = std::make_shared<Aws::S3::S3Client>(config);
static ossimPreferences * instance()
std::shared_ptr< Aws::S3::S3Client > m_client
◆ instance()
◆ isS3Url()
bool ossim::AwsStreamFactory::isS3Url |
( |
const ossimFilename & |
file | ) |
const |
|
protected |
- Returns
- true if starts with "s3://" or "S3://"
◆ m_client
std::shared_ptr<Aws::S3::S3Client> ossim::AwsStreamFactory::m_client |
|
mutableprotected |
◆ m_instance
The documentation for this class was generated from the following files: