mirror of
https://gitee.com/openharmony/filemanagement_app_file_service
synced 2024-11-23 16:10:07 +00:00
跨设备文件分享路径转换
Signed-off-by: cuiruibin <cuiruibin3@huawei.com>
This commit is contained in:
parent
daef50e12c
commit
166a3aedee
@ -89,7 +89,8 @@ string FileUri::GetRealPath()
|
||||
return realPath;
|
||||
}
|
||||
|
||||
if ((bundleName != "") && (bundleName != CommonFunc::GetSelfBundleName())) {
|
||||
if (((bundleName != "") && (bundleName != CommonFunc::GetSelfBundleName())) ||
|
||||
uri_.ToString().find(NETWORK_PARA) != string::npos) {
|
||||
realPath = PATH_SHARE + MODE_RW + bundleName + sandboxPath;
|
||||
if (access(realPath.c_str(), F_OK) != 0) {
|
||||
realPath = PATH_SHARE + MODE_R + bundleName + sandboxPath;
|
||||
|
@ -151,7 +151,8 @@ HWTEST_F(NDKFileUriTest, get_path_from_uri_test_004, TestSize.Level1)
|
||||
fileUriStr += "data/storage/el2/base/haps/entry/files/GetPathFromUri004.txt";
|
||||
fileUriStr += "?networkid=64799ecdf70788e396f454ff4a6e6ae4b09e20227c39c21f6e67a2aacbcef7b9";
|
||||
const char *fileUri = fileUriStr.c_str();
|
||||
std::string filePathStr = "/data/storage/el2/distributedfiles/.remote_share/";
|
||||
std::string filePathStr =
|
||||
"/data/storage/el2/share/r/" + BUNDLE_A + "/data/storage/el2/distributedfiles/.remote_share/";
|
||||
filePathStr += "data/storage/el2/base/haps/entry/files/GetPathFromUri004.txt";
|
||||
const char *filePath = filePathStr.c_str();
|
||||
char *result = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user