65 GridFileManager(
const CommonStorageInterfacePrx& databasePrx,
const std::string& cachePath);
82 bool getFileStream(GridFileInterfacePrx& filePrx, std::ifstream& fs);
92 bool getFileStream(
const EntityAttributeBasePtr& fileAttr, std::ifstream& fs);
107 std::string& cacheFileName,
108 bool preserveOriginalName =
false);
123 std::string& cacheFileName,
124 bool preserveOriginalName =
false);
139 std::vector<std::string>& cacheFileNames,
140 bool preserveOriginalNames =
false);
154 bool preserveOriginalNames =
false);
168 const std::string& localFileName,
169 EntityAttributeBasePtr& fileAttr,
170 const std::string& gridFSName =
"");
184 const std::string& localFileName,
185 EntityAttributeBasePtr& fileAttr,
186 const std::string& gridFSName =
"");
199 const std::string& localDirectoryName,
200 EntityAttributeBasePtr& fileAttr,
201 std::string excludeFilter =
".svn");
216 const std::string& localBaseDirectoryName,
217 const std::vector<std::string>& localFiles,
218 EntityAttributeBasePtr& fileAttr);
220 bool removeAttrFile(
const EntityAttributeBasePtr& fileAttr,
unsigned int fileIndex);
240 CommonStorageInterfacePrx
247 void init(std::string cachePath);
250 std::filesystem::path fileCachePath;
251 CommonStorageInterfacePrx databasePrx;
253 GridFileInterfacePrx getFileProxyFromAttr(
const AttributeBasePtr& attr)
const;
254 GridFileList getFileProxiesFromAttr(
const AttributeBasePtr& attr)
const;
256 MongoDBRefPtr extractMongoDBRef(
const AttributeBasePtr& attr)
const;
259 std::string makeRelativePath(
const std::filesystem::path& directory,
260 const std::filesystem::path& basePath);
bool storeFilesToAttr(const std::string &filesDBName, const std::string &localBaseDirectoryName, const std::vector< std::string > &localFiles, EntityAttributeBasePtr &fileAttr)
Stores a set of files with in GridFS and puts a reference to it into entity attribute.
std::string addFileToAttr(const std::string &filesDBName, const std::string &localFileName, EntityAttributeBasePtr &fileAttr, const std::string &gridFSName="")
Stores a file in GridFS and puts a reference to it into entity attribute.
bool storeDirectoryToAttr(const std::string &filesDBName, const std::string &localDirectoryName, EntityAttributeBasePtr &fileAttr, std::string excludeFilter=".svn")
Stores a complete directory tree in GridFS and puts a reference to it into entity attribute Overwrite...
std::string storeFileToAttr(const std::string &filesDBName, const std::string &localFileName, EntityAttributeBasePtr &fileAttr, const std::string &gridFSName="")
Stores a file in GridFS and puts a reference to it into entity attribute.