31 #include <MemoryX/interface/components/CommonStorageInterface.h>
32 #include <MemoryX/interface/core/EntityBase.h>
33 #include <MemoryX/interface/core/GridFileInterface.h>
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);