20 #include "boost/lexical_cast.hpp"
30 const std::string& _object_path,
31 std::string& _collection_name,
32 std::string& _object_name ) {
33 namespace bfs = boost::filesystem;
36 bfs::path
p(_object_path);
37 _collection_name =
p.parent_path().string();
38 _object_name =
p.filename().string();
40 catch(
const bfs::filesystem_error& _e) {
47 const std::string& _logical_path,
48 const std::string& _physical_path,
49 const std::string& _resc_hier ) {
54 _logical_path.c_str(),
58 _physical_path.c_str(),
77 boost::format(
"rsDataObjChksum failed for [%s] on [%s]") %
87 const std::string& _object_path,
88 const std::string& _resource_hierarchy,
89 const std::string& _file_path ) {
91 rstrcpy(stat_inp.objPath, _object_path.c_str(),
sizeof(stat_inp.objPath));
92 rstrcpy(stat_inp.rescHier, _resource_hierarchy.c_str(),
sizeof(stat_inp.rescHier));
93 rstrcpy(stat_inp.fileName, _file_path.c_str(),
sizeof(stat_inp.fileName));
95 const auto status_rsFileStat =
rsFileStat(_comm, &stat_inp, &stat_out);
96 if(status_rsFileStat < 0) {
99 boost::format(
"rsFileStat of objPath [%s] rescHier [%s] fileName [%s] failed with [%d]") %
104 return status_rsFileStat;
107 const auto size_in_vault = stat_out->st_size;
109 return size_in_vault;
127 catch (boost::bad_lexical_cast&) {
128 rodsLog(
LOG_ERROR,
"[%s] - bad_lexical_cast for dataSize [%s]; setting to 0", __FUNCTION__, data_size_str);
130 data_size_str =
nullptr;
133 if (
nullptr == data_size_str) {
137 const auto dst_size_str = boost::lexical_cast<std::string>(dst_size);
144 std::string dst_checksum;
145 if(strlen(src_info->
chksum) > 0) {
151 if(!dst_checksum.empty() &&
152 dst_checksum != src_info->
chksum) {
155 dst_checksum.c_str(),
156 sizeof(dst_info->
chksum));
160 dst_checksum.c_str());
164 if(reg_param.len > 0) {
172 mod_inp.regParam = ®_param;
177 boost::format(
"rsModDataObjMeta failed for [%s] on resc [%s]") %
197 (
const char* )srcDataObjInfo->
objPath,
203 std::string svc_role;
217 "role not supported [%s]",
254 std::string svc_role;
265 int savedClientAuthFlag;
293 if ( status2 >= 0 ) {
294 destDataObjInfo->
replNum = status2;
306 "role not supported [%s]",
324 if ( pdmo_kw !=
NULL ) {
325 file_obj->in_pdmo( pdmo_kw );
329 if ( admin_kw !=
NULL ) {
338 std::stringstream msg;
340 msg <<
" - Failed to signal resource that the data object \"";
341 msg << destDataObjInfo->
objPath;
342 msg <<
"\" was registered";
343 ret =
PASSMSG( msg.str(), ret );